JAVa JFinal + EazyUI =Grid例子,jfinaleazyui

來源:互聯網
上載者:User

JAVa JFinal + EazyUI =Grid例子,jfinaleazyui

 

前台

<div id="dg"></div>

js

$(function() {$('#dg').datagrid({height:'400px',pageNumber:1,title:'日誌列表',pageList:[10,20,30,40,50],striped: true,  pagination:true,rownumbers: true,     singleSelect:true,method: 'POST',url: '/LogInfo/getLogList',loadMsg:'資料載入中請稍後……',  onBeforeLoad: function (param) {param.falg = new Date();        },columns : [ [               {field : 'Title',title : '標題',width : 300,align : 'left'},               {field : 'Type',title : '類型',width : 100,align : 'center'},               {field : 'IP',title : 'IP',width : 200,align : 'center'},              {field : 'RequestUrl',title : '請求地址',width : 100,align : 'left'},               {field : 'Remark',title : '操作資訊',width : 100,align : 'left'},              {field : 'OperationID',title : '操作人員',width : 100,align : 'center'},               {field : 'OperationTime',title : '操作時間',width : 100,align : 'center'}              ] ]});//設定分頁控制項  var p = $('#dg').datagrid('getPager');  $(p).pagination({      pageSize: 10,//每頁顯示的記錄條數,預設為10      beforePageText: '第',//頁數文字框前顯示的漢字      afterPageText: '頁    共 {pages} 頁',      displayMsg: '當前顯示 {from} - {to} 條記錄   共 {total} 條記錄',      /*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 = BusinessFactory.CreateLogInfoBusiness();Page<LogInfo> logInfo = logInfoBusiness.GetPageList(page, rows, "",new ArrayList<Object>());renderJson("{\"total\":"+logInfo.getTotalRow()+",\"rows\":" + JsonKit.toJson(logInfo.getList())+"}");}


對應的方法擷取

@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;}


 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.