Note that there are some explanatory texts on larger screens.

plurals
  1. POPagination with selected check boxes. Checkboxes will only work on current pagination page. jQuery datatables
    primarykey
    data
    text
    <p>I'm using the <a href="http://datatables.net/index">jquery datatables plugin</a>.</p> <p>I have just a straight html table layout for it.</p> <pre><code>&lt;table class="display" id="contactsTable"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Id&lt;/th&gt; &lt;th&gt;Email&lt;/th&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Phone&lt;/th&gt; &lt;th&gt;City&lt;/th&gt; &lt;th&gt;State&lt;/th&gt; &lt;th&gt;Arrival&lt;/th&gt; &lt;th&gt;Departure&lt;/th&gt; &lt;th&gt;Inserted&lt;/th&gt; &lt;th&gt;Check&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;301&lt;/td&gt; &lt;td&gt;email address&lt;/td&gt; &lt;td&gt;Test&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;July 14 2011&lt;/td&gt; &lt;td&gt;July 23 2011&lt;/td&gt; &lt;td&gt;April 12 2011 07:05&lt;/td&gt; &lt;td&gt;&lt;input type="checkbox" name="selected[]" value="301" class="chkbox"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;300&lt;/td&gt; &lt;td&gt;email&lt;/td&gt; &lt;td&gt;Test&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;September 02 2011&lt;/td&gt; &lt;td&gt;September 10 2011&lt;/td&gt; &lt;td&gt;April 11 2011 12:01&lt;/td&gt; &lt;td&gt;&lt;input type="checkbox" name="selected[]" value="300" class="chkbox"/&gt;&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>Here is my code for submit (just temp).</p> <pre><code>&lt;input id="submitButton" type="submit" value="Submit" onclick="test()" /&gt; </code></pre> <p>And my javascript to map the checkboxes to an array.</p> <pre><code>function test() { var values = $('input:checkbox:checked.chkbox').map(function () { return this.value; }).get(); console.log(values); } </code></pre> <p>Here is the datatables code</p> <pre><code> $(document).ready(function() { var selected; var selectedOutput = '#selectedOutput'; var template = 'selectedTemplate'; var submitButton = '#submitButton' var dTable = $('#contactsTable').dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers", "bPaginate": true, "bLengthChange": true, "bFilter": true, "bSort": false, "bInfo": true, "bAutoWidth": false, "bProcessing": true, "aoColumns": [ {"bVisible": false }, //keep the id invisble null, null, null, null, null, null, null, null, null ] }); </code></pre> <p>The problem is, I can't do a checkbox selection across a page. The table has mutiple pages to it. If I click submit, it only submits the array of checkboxes for the current page I am on.</p> <p>I hope this is clear enough. I'm not sure what is happening. Thanks for any help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload