JAVa jfinal + Eazyui =grid Example

Source: Internet
Author: User

Front desk

<div id= "DG" ></div>

Js

$ (function () {$ (' #dg '). DataGrid ({height: ' 400px ', Pagenumber:1,title: ' Log list ', pagelist:[10,20,30,40,50],striped: True, Pagination:true,rownumbers:true, Singleselect:true,method: ' POST ', url: '/loginfo/getloglist ', loadmsg: '        Data loading Please later ... ', onbeforeload:function (param) {param.falg = new Date (); },columns: [[{field: ' title ', Title: ' title ', Width:300,align: ' Left '}, {field: ' Type ', tit              Le: ' type ', width:100,align: ' Center '}, {field: ' IP ', title: ' IP ', width:200,align: ' Center '},  {field: ' Requesturl ', title: ' Request Address ', Width:100,align: ' Left '}, {field: ' Remark ', title: ' Operation Info ', width : 100,align: ' Left '}, {field: ' OperationID ', title: ' operator ', width:100,align: ' Center '}, {F Ield: ' Operationtime ', title: ' Operation Time ', Width:100,align: ' Center '}]});//Set paging control var p = $ (' #dg '). DataGrid  (' Getpager '); $ (P). Pagination ({pagesize:10,//shows the number of record bars per page, by default, Beforepagetext: ' First ',///Page text box to display the Chinese characters afterpagetext: ' pages total {pages} page ', displaymsg: ' Current display {from}-{to} record total} record ',         /*onbeforerefresh:function () {$ (this). Pagination (' loading ');         Alert (' before Refresh ');     $ (this). Pagination (' loaded ');  }*/ }); });


Action

public void Getloglist () {int page = getparatoint ("page"); int rows = Getparatoint ("Rows"); Iloginfo loginfobusiness = Busin Essfactory.createloginfobusiness (); page<loginfo> loginfo = loginfobusiness.getpagelist (page, rows, "", New Arraylist<object> ()); RenderJson (" {\ "total\": "+loginfo.gettotalrow () +", \ "rows\": "+ Jsonkit.tojson (loginfo.getlist ()) +"} ");}


The corresponding method gets

@Overridepublic page<loginfo> getpagelist (int Page, int rows, String sql,list<object> param) {if (param.size () ==0) {Param.add (1);} page<loginfo> list= LogInfo.me.paginate (page, rows, "Select  *  ", "from Loginfo where 1=?  ") +sql, Param.toarray ()); return list;}


JAVa jfinal + Eazyui =grid Example

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.