Queryparams of Jquery-easyui-datagrid parameters

Source: Internet
Author: User

http://blog.163.com/xpf_designer/blog/static/19213618920117784055668/

Html

<div region= "center" border= "false" style= "padding:0px 3px 0px 3px;margin:0px;" >

<table id= "Test" ></table>

</div>

Initial gird of the first place

$ (function () {

Loadgrid ();

Loadcombobox (NULL);

});

function Loadgrid () {

$ (' #test '). DataGrid ({

Title: ' Appointment and dismissal Information list ',

Fit:true,

Nowrap:false,

Striped:false,

URL: ' Rm.json ',

URL: ' Http://127.0.0.1:8080/web/AppAndRemoveServer.server ',

queryparams:{},

Sortname: ' appandremove_id ',

SortOrder: ' ASC ',

Remotesort:false,

IDfield: ' appandremove_id ',

frozencolumns:[[

{field: ' CK ', checkbox:true}

]],

Columns:[[{field: ' appandremove_id ', title: ' Batch number ', Width:200,sortable:true},

{field: ' Batch_name ', title: ' Batch Name ', Width:240,sortable:true},

{field: ' Batch_no ', title: ' Batch number ', Width:100,sortable:true},

{field: ' Recorder_date ', title: ' Registration Time ', width:120,sortable:true},

{field: ' recorder_id ', title: ' Registrant ', width:100,sortable:true},

{field: ' state ', title: ' Status ', Width:100,sortable:true},

{field: ' Memo ', title: ' Remarks ', width:300}

]],

Pagination:true,

Pagenumber:1,

Pagesize:5,

PAGELIST:[5,10],

Singleselect:true,

Rownumbers:true

});

}


server receives rows, page, order, sort parameters

The parameter name is Easyui, and the value is automatically bound

Can be passed Request.getparameternames () on the service side; see what parameters

Receive parameter values

if (Null!=request.getparameter ("Rows")) {Pagerows=integer.parseint (Request.getparameter ("Rows"). toString ());

}

if (Null!=request.getparameter ("page")) {

Page=integer.parseint (Request.getparameter ("page"). toString ());

}

if (Null!=request.getparameter ("Order")) {

Order=request.getparameter ("Order"). ToString ();

}

if (Null!=request.getparameter ("sort")) {

Order=request.getparameter ("Sort"). ToString ();

}

Then assemble the SQL statement to implement the paging.


Add query parameters, Reload table

function Reloadgrid (stateval) {

Query parameters are added directly in the URL

/* var url =$ (' #test '). DataGrid (' Options '). URL;

url = "http://127.0.0.1:8080/web/AppAndRemoveServer.server?state=" +stateval;

Reassign URL Properties

$ (' #test '). DataGrid (' Options '). Url=url;

$ ("#test"). DataGrid (' reload ');

*/

Query parameters are added directly in Queryparams

var queryparams = $ (' #test '). DataGrid (' Options '). Queryparams;

Queryparams.state = Stateval;

$ (' #test '). DataGrid (' Options '). Queryparams=queryparams;

$ ("#test"). DataGrid (' reload ');

}

Queryparams of Jquery-easyui-datagrid parameters

Related Article

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.