大佬教程收集整理的这篇文章主要介绍了jquery – 使用数据表的服务器端分页,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
var tableData = self.accountCollection.getData(); var tablecolumns = this.accountCollection.getcolumns(); var @R_406_10586@lRecs = this.accountCollection.length; //create the UI grid containing the list of items this.resultsTable = tableEl.dataTable( { "bServerSide": true,"sEcho": 3,"i@R_406_10586@lRecords": @R_406_10586@lRecs,"i@R_406_10586@lDisplayRecords": 15,"aaData": tableData,"aocolumns": tablecolumns,"aaSorTing": [[1,'asc']],}); getData: function () { var returnData = []; $.each(this.models,function (idx,accountModel) { returnData.push(accountModel.attributes); }); return returnData; },
returnData将返回一个Object,其中包含我将填充表格的字段:
对象重新调整:(大致)
Object accountName: "No Company" address1: "1234 asdf" address2: "" billingAcctId: null billingSystem: null city: "mountain view" comments: null country: "USA"
然后将调用getData()函数以使用以下方法从datatbase重新调整数据:
var tableData = this.accountCollection.getData()
所以基本上tableData将具有在表中显示的必要字段和值.现在我可能有超过1000条从服务器返回的记录.因此我需要分页.
小提琴中的那个是我尝试过并且对paginaTin没有任何影响..
以上是大佬教程为你收集整理的jquery – 使用数据表的服务器端分页全部内容,希望文章能够帮你解决jquery – 使用数据表的服务器端分页所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。