Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/460.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在datatable中进行服务器端分页?_Javascript_Ajax_Data Paging - Fatal编程技术网

Javascript 如何在datatable中进行服务器端分页?

Javascript 如何在datatable中进行服务器端分页?,javascript,ajax,data-paging,Javascript,Ajax,Data Paging,我正在使用MVC。我有大量的数据,我只需要有分页限制的数据。例如,如果页面大小为10,我只想获取数据库中前10条记录 这是我的html: <table class="table table-striped table-bordered table-hover" id="data_table"> <thead> <tr> <th> Anket Id </th> <th> Anket Adı <

我正在使用MVC。我有大量的数据,我只需要有分页限制的数据。例如,如果页面大小为10,我只想获取数据库中前10条记录

这是我的html:

<table class="table table-striped table-bordered table-hover" id="data_table">
  <thead>
    <tr>
    <th> Anket Id  </th>
    <th> Anket Adı </th>
    <th> Katılımcı </th>
    <th> Soru      </th>
    <th> Aktif Gün </th>
    <th> Dil       </th>
    <th> Durum     </th>
    <th> Kayıt Tarihi </th>            
</table>
这就是我的服务器返回的json:

 {"sEcho": 3,"iTotalRecords" : 1013,"iTotalDisplayRecords" : 1013,"aaData" :   [["56523938aa9c580dac1858e5","anket-0","1001","8","11","TR","Aktif","22.11.2015 23:52"],

["5652393aaa9c580dac185918","anket-1","1000","8","11","TR","Aktif","22.11.2015 23:52"]]}
当我运行程序时,它在加载数据表时给出“无法读取未定义属性长度”错误。如果我做错了,请感谢您提供的任何解决方案。

尝试类似的方法
如果您想实现自己的带有分页的表,请执行与Jqgrid相同的操作

您使用什么技术?什么是DataTable函数?服务器端代码是什么样的?DataTable函数是众所周知的bootstarpt DataTable,我的服务器端代码是这样的:[HttpGet]public JsonResult ActiveSurveysPaging(int-iDisplayStart,int-iDisplayLength){..return jsonObject}您好,我在这个链接中看不到分页部分,你能帮我找到它吗?在这里找到
 {"sEcho": 3,"iTotalRecords" : 1013,"iTotalDisplayRecords" : 1013,"aaData" :   [["56523938aa9c580dac1858e5","anket-0","1001","8","11","TR","Aktif","22.11.2015 23:52"],

["5652393aaa9c580dac185918","anket-1","1000","8","11","TR","Aktif","22.11.2015 23:52"]]}