BUG with version 1.7.3 - checked checkboxes are unchecked when paginate

BUG with version 1.7.3 - checked checkboxes are unchecked when paginate

diondudiondu Posts: 24Questions: 0Answers: 0
edited October 2010 in Bug reports
I'm using version 1.7.3 and have a table (not in ajax) with checkboxes inside columns.

I check a checkbox, then paginate the table and return to the previous page the checkbox apear unchecked.

The table doesn't remember that the checkbox was checked.

Fernando

Replies

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    Are you using IE6? This is a known issue with that browser and is simply a bug in IE6, not an issue with DataTables - sorry. The work around is to keep an array of all the select elements, and then on each draw see if any of the checkboxes need to be checked. Bit rubbish, but that's IE6 for you.

    For all the other browsers I've tried this in, I've not seen this issue.

    Allan
  • eleventheleventh Posts: 4Questions: 0Answers: 0
    edited October 2010
    Hi, I also have a similar problem. Using version 1.7.4.

    I have a column with checkbox, i checked a few rows, paginate, submit the form, but no checked values was received on the backend. It seems that as the page paginate, the rows on the first page is removed from the DOM, thus the backend doesnt see it.

    But if i select 100 entries to show, I am able to check these and send to backend. The problem only occurs with pagination.

    Any options to disable removal from DOM but using something like show/hide?
  • rfitzwaterrfitzwater Posts: 57Questions: 5Answers: 1
    I too am having this problem. My table has many pages. If I check results on various pages, paginate back or forth all boxes that I checked are still displayed as being checked. The problem is, only the checkboxes that are on the visible page of the table are submitted in the form.

    Looking for suggestions as well...
  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    @eleventh and rfitzwater - it sounds like you are both having a slightly different problem from the original issue. Have a look at this example for one method which can be used to submit information to the server: http://datatables.net/examples/api/form.html .

    An alternative is to use the fnGetHiddenNodes ( http://datatables.net/plug-ins/api#fnGetHiddenNodes ) to get the hidden nodes and manipulate them as needed. There are a number of threads on this subject such as:

    http://datatables.net/forums/comments.php?DiscussionID=185
    http://datatables.net/forums/comments.php?DiscussionID=2470

    Allan
  • rfitzwaterrfitzwater Posts: 57Questions: 5Answers: 1
    So my table is part of a larger form that has multiple tables. Check it out here: http://dev2.njschooljobs.com On the right hand side, if you click in the text box next to County, Specialty, or School and modal window with the table appear. If you click county, the select Burlington, skip to next page, select Monmouth, close the window, then click Search Jobs Now. You will see that only the jobs in Monmouth county appear. My input elements are all named county. The backend code is correct as it is sending and parsing multiple selections. The problem is its only sending the checkbox values that are selected on the last viewed table page.

    Should I be creating a hidden form element that will store the checkbox values? Looking for the easiest way to achieve this. Help is appreciated.

    Thanks,

    Rhon
  • eleventheleventh Posts: 4Questions: 0Answers: 0
    edited November 2010
    Hi Allan,

    Thanks for the pointing out the direction... I managed to get it to work with this code:
    [code]
    var table = $('table.dataTable').dataTable();

    $('.submitDataTable').click(function() {
    var hiddenRows = table.fnGetHiddenTrNodes();
    $('table.dataTable tbody').append(hiddenRows);
    });
    [/code]

    But be advised that this won't work on IE6 as pointed out in http://datatables.net/forums/comments.php?DiscussionID=185

    Cheers,
    11th
  • CraigAgnewCraigAgnew Posts: 2Questions: 0Answers: 0
    edited April 2011
    Old post but had come across it on my search for a solution. If anyone is still looking you can find a solution in http://datatables.net/forums/comments.php?DiscussionID=185&page=1#Item_12

    Craig
This discussion has been closed.