Easyui Treegrid Pagination

Source: Internet
Author: User

$ (function () {

$ (' #maintable '). Treegrid ({

Width: ' 98% ',
HEIGHT:550,
Nowrap:true,
Striped:true,
Fit:true,
URL: '/module/getmodulelist ',
IDfield: ' menu_id ',
Fitcolumns:false,
Queryparams: {
ModuleName: $ ("#txtModuleName"). TextBox (' GetValue '),
AppID: $ ("#txtSystem"). ComboBox (' GetValue '),
Ishide: $ ("#isHide"). ComboBox (' GetValue ')
},

Columns: [[
{field: ' CK ', checkbox:true},
{field: ' menu_id ', Title: ' Module Number ', width:150, align: ' Left ', Hidden: ' True '},
{
Field: ' Menu_name ', title: ' Module name ', width:250, align: ' left '
},
{
Field: ' Nav_url ', title: ' Address ', width:250, align: ' left '
},
{
Field: ' Is_hide ', title: ' Hidden ', width:100, align: ' left '
},
{
Field: ' Show_order ', title: ' Sort ', width:100, align: ' left '
}
]],
onbeforeload:function (row,param) {
if (!row) {//Load top level rows
Param.id = 0;//set id=0, indicate to load new page rows
}
},
Treefield: ' Menu_name ',
Pagination:true,
Rownumbers:true,
Pagenumber:1,

Pageposition: ' Buttom '

});

Set up pagination controls
var p = $ (' #maintable '). DataGrid (' Getpager ');
$ (P). Pagination ({
pagesize:10,//the number of records displayed per page, default is 10
PageList: [5, 10, 25],//can set a list of the number of record bars per page
Beforepagetext: ' First ',///page text box before the Chinese characters displayed
Afterpagetext: ' page total {pages} ',
Displaymsg: ' current display {from}-{to} ' record ' {total} ' record '

});

});

<div class= "Panel" style= "padding:0 10px; height:520px; " >
<table id= "maintable" class= "Easyui-treegrid" ></table>
</div>

Background code:

public string Getmodulelist ()
{
GET request Information
int intpagesize = Int. Parse (request["Rows"]. ToString ());//Display rows per page
int intcurrentpage = Int. Parse (request["page"]. ToString ());//Current page
String strishide = request["Ishide"]. ToString ();
String strappid = request["AppID"]. ToString ();
String strmodulename = request["ModuleName"]. ToString ();
string strmenuid = request["id"]. ToString ();//parent node value, parameter can only be ID, cannot be other name

Total Record Count
int totalcount = 0;
Paged Get list of users
DataTable dt = Modulebll.getlistbypage (Intpagesize, Intcurrentpage, out TotalCount, strModuleName, Strishide, StrAppID, STRMENUID);
String strresult = easybll.getmodulelist (dt, totalcount);
return strresult;
}

Easyui Treegrid Pagination

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.