Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/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
Jquery 如何将数据表分页中的记录发送到服务器类_Jquery_Pagination_Datatables - Fatal编程技术网

Jquery 如何将数据表分页中的记录发送到服务器类

Jquery 如何将数据表分页中的记录发送到服务器类,jquery,pagination,datatables,Jquery,Pagination,Datatables,当我单击全选(超链接)选项或我希望特定页面中的特定记录(使用复选框)时,我试图发送jQuery数据表中的所有记录到服务器类,但问题是当我单击表单提交按钮时,即导出PDF仅从当前页面获取记录,即使在jquery数据表分页的其他页面中选择了记录 <s:form id="downloadStudentDetailsForm" action="downloadStudentDetails" theme="css_xhtml" cssClass="form-horizontal"> <

当我单击全选(超链接)选项或我希望特定页面中的特定记录(使用复选框)时,我试图发送jQuery数据表中的所有记录到服务器类,但问题是当我单击表单提交按钮时,即导出PDF仅从当前页面获取记录,即使在jquery数据表分页的其他页面中选择了记录

<s:form id="downloadStudentDetailsForm" action="downloadStudentDetails" theme="css_xhtml" cssClass="form-horizontal">

<div class="dataTable_wrapper">
<table width="100%" class="table table-striped table-bordered table-hover" id="dataTS">
<thead>
<tr>
<th><a href="#" id="selectall">Select all</a></th>
<th>Student Name</th>
<th>Parent Phone</th>   
<th>Parent Email</th>                                                       
<th>ReferenceID</th>
</tr>
</thead>
<tbody>
<s:iterator value="studentRecords">
<tr>
<td><s:checkbox name="students" cssClass="case chkPassport" fieldValue="%{studentname+' '+phone+' '+email+' '+ref}"  /></td>                                                            
<td><s:property value="studentname" /></td> 
<td><s:property value="phone" /></td>   
<td><s:property  value="email"></td>                                                        
<td><s:property value="ref" /></td>
 </tr>
 </s:iterator>
 </tbody>
 </table>
 </div>
 <div class="col-xs-1 ">
 <s:submit cssClass="btn btn-success" value="Export to Excel" id="exl" action="downloadStudentsListINExcel" />
 </div>
 <div class="col-xs-3 ">
 <s:submit cssClass="btn btn-danger" value="Export to PDF" id="pdf" action="downloadStudentsListInPDF" />
 </div>   
 </s:form> 

请参见此处:

答案应该是:

var allPages = table.fnGetNodes();
请看这里:

答案应该是:

var allPages = table.fnGetNodes();

我已经为复选框提供了id,然后下面的代码正在为我工作

 $(document).ready(function() {  
            $('#yourDataTableID').DataTable();  
            $("#button").click(function() {  
                var chcklist = new Array();  
                var oTable = $('#yourDataTableID').dataTable();  
                var rowcollection =  oTable.$("#checkboxID:checked", {"page": "all"});  
                rowcollection.each(function(index,elem) {  
                    chcklist.push($(elem).val());    
                });       

                 $.ajax({
                      type : 'POST',
                       url: "/DataTableQuery/checkPaginatedData",
                      dataType : 'JSON',
                      data : {list: chcklist},
                      success : function(data, success) {           

                }
              }); 
            });  
        });

我已经为复选框提供了id,然后下面的代码正在为我工作

 $(document).ready(function() {  
            $('#yourDataTableID').DataTable();  
            $("#button").click(function() {  
                var chcklist = new Array();  
                var oTable = $('#yourDataTableID').dataTable();  
                var rowcollection =  oTable.$("#checkboxID:checked", {"page": "all"});  
                rowcollection.each(function(index,elem) {  
                    chcklist.push($(elem).val());    
                });       

                 $.ajax({
                      type : 'POST',
                       url: "/DataTableQuery/checkPaginatedData",
                      dataType : 'JSON',
                      data : {list: chcklist},
                      success : function(data, success) {           

                }
              }); 
            });  
        });