checkboxes in datatables?
checkboxes in datatables?
veloopity
Posts: 87Questions: 36Answers: 2
my customer wants a new functionality that would allow him to choose certain data rows, for instance by adding a checkbox for each line (the table would have to be placed inside a form, and there would be a submit button somewhere). I haven't tried if that works yet - can it be done? even if paging is switched on? even if the table is fed by javascript?
Or could the choosing be done in another way?
-Michael
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
you can.
what i have done for my server processed table...
thank you !!
could someone please help me with the render function? I'm not much of a javascript expert and what I found in the discussions is way beyond my understanding.
My data come from a database of course, the page is generated with ColdFusion (think: PHP). The datatables are inside of a form. Each line has a checkbox whose name corresponds to the database row id. On submitting the form, the checked checkboxes are evaluated and used to create a new page with averages over the selected rows.
Here is a very simple datatables example page with static data. When I write it like this, checkboxes are displayed but they don't work - they aren't recognized as form elements. How would one do it?
(... and how does one format code here? when I choose 'code' it comes out like this - is there something like "pre"?)
Use a triple back tick. See the documentation here.
As in they aren't rendered as checkboxes? It looks okay to me from the above code (although your have redundant escaping about the double quotes for the type attribute's value).
I'd need a link to a test case showing the issue to understand the problem better.
Allan
thx Allan no, they're looking like checkboxes but when I place the whole thing into a form, check some of the boxes, and send the form, they don't arrive on the target page.
Will try to set up a test case for you.
You might be interested in this example.
Allan
hi Allan, never mind. I just found that it was a problem with divs closing inside of the very complex form, apparently cutting off form fields that followed. Got it working now I think
Many thanks !!!!