A simple instance jumps to a specified Page Based on Datatables, and jumps to an instance based on datatables
Because the project uses Datatables to find that you cannot jump to a specified page when the page is too large, you have added the # Ables jump to a specified page # function by yourself. The implementation code is as follows:
Table = $ ('# user-table '). dataTable ({"bAutoWidth": false, "processing": true, "serverSide": true, "bStateSave": true, "pagingType": "full_numbers", "order ": [[0, 'asc '], "ajax": get_users, "oLanguage": {"sUrl": "/js/advanced-datatable/lang/Chinese. json "}," drawCallback ": function (settings) {if ($ ('body '). height () <document.doc umentElement. clientHeight) {comment ('footer'character .css ('position', 'fixed');} else {comment ('footer'character .css ('position', 'static ');} if (sla_type = 1) {table. api (). column (4 ). visible (false);} else {table. api (). column (4 ). visible (true);} // core implementation: it cannot be placed in the initComplete method, because the jump function disappears if (table. api () .page.info (). pages> 1) {$ ("# dynamic-table_info "). append ('<div class = "jump-page"> jump to <input type = "number" id = "jump_page" min = "1"> page </div> '); }}, "initComplete": function (settings, json) {if ($ ('body '). height () <document.doc umentElement. clientHeight) {comment ('footer'character .css ('position', 'fixed');} else {comment ('footer'character .css ('position', 'static ');} $ ('. adv-table input [type = "search"] '). addClass ('form-control');}, "rowCallback": function (row, data) {$ ('td: eq (0) ', row ). attr ('title', 'Role permission: '+ data [11]) ;},}); // Ables jumps to the specified page $ ("body "). delegate ('# jump_page', 'keyup', function (event) {var page = Number ($ (this ). val (); if (event. keyCode = 13 & page> 0) {table. api (). page (page-1 ). draw (false );}});
The above simple example of redirecting to a specified Page Based on Datatables is all the content shared by xiaobian. I hope to give you a reference and support for the customer's house.