Datatable1.10 server disconnection page

Source: Internet
Author: User

Next, the new feature of ableable1.10 in the previous article. For work requirements, We Need To paging the server.

I still take the Code directly .. Add comments to the code .. If you have any questions, give me some advice...

$ (Document). Ready (function (){
VaR table = $ ('# example'). datatable ({
"Columns": _ tablecols,
"Createdrow": xxxxxx, // function name
"Processing": True, // when the data is not fully loaded at once, the page displays loading in progress.
"Serverside": True, // if it is set to true, the server page is displayed.
"Pagingtype": "full_numbers", // display form of the paging button
"Paging": True, // if it is false, all data is displayed on a page.
"Ajax ":{
"Url": "xxxx/query ",
"Type": 'post ',
"Data": function (d ){
D. orderby = "position ";
},
"Datasrc": function (JSON ){
Return JSON. records;
},
},
});

});


// The above JS Code is all written. If you need to add other attributes, such as lengthmenu, etc... See the server side processing URL for: http://datatables.net/manual/server-side


I use the springmvc framework. Therefore, the returned object must contain the recordsfiltered and recordstotal long integer parameters. Otherwise, an error is reported (for example, the number of showing 1 to 10 of 57 entries is Nan ). For more information, see the JSON data source on the official website. Therefore, the returned object should contain two parameters.

// Recordsfiltered is the total number of records in the data set after filtering
Private long recordsfiltered = 0;
// Total number
Private long recordstotal = 0;

If you have any questions, please leave a message ....

Datatable1.10 server disconnection page

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.