Newbie question about radio buttons in a cell

Newbie question about radio buttons in a cell

snorkelsnorkel Posts: 1Questions: 0Answers: 0
edited March 2011 in General
Hi,
Just discovered this and have it working in my app without issue. I am running into a issue with having a radio button in the first column and using pagination or the filtering.
What happens is when I search the datatable and then select a new radio button from the filtered down list, and then
clear the filter the original selected radio button is back and the one I selected from the search results is not checked.

I have a jquery click event for the radio buttons that does a ajax post to the server and sets the ID of the button in the session, it also updates a heading on the page.

Similar thing happens with pagination enabled, but in this case if I go tot he second page the radio buttons don't respond to the click event, and this depends on how the sorting is set, if I have it sorted Asc it's the first page that does not work, and if I go to the second page the radio buttons click events work.

Hope I am explaining this right. I looked in the forums and could not see anything that would help with this.

I am generating the table in my templates (mako using Cherrypy) like this:

${row['coname']}

Thanks,

Snorkel

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Regarding the events not working on the second page, this FAQ should help: http://datatables.net/faqs#events .

    Are you using server-side processing or DOM based data? With server-side you would need to maintain the checkbox state on the client-side since the rows are recreated on every draw.

    Allan
This discussion has been closed.