rowOrder and Input Radio
rowOrder and Input Radio
Hello everybody,
I'm writing to ask help.
I want to create a table like this one
https://datatables.net/extensions/select/examples/initialisation/checkbox.html
with checkboxes in the first column and i want to let the user to change the row's order
https://editor.datatables.net/examples/extensions/rowReorder
is it possible?
I have tried but inputs are not clicckable and the row order dosen't work, seems are confictual.
Can i have some code examples please?
Js
$('#example').DataTable({
columnDefs: [ {
orderable: true,
className: 'select-checkbox',
targets: 0
} ],
select: {
style: 'multi',
},
rowReorder: {
selector: 'tr'
}
});
then in the html page I use
Jquery
Data tables.select
and rowReorder
thanks
Answers
Here is an example using the select checkbox along with row reorder.
http://live.datatables.net/cemokopu/1/edit
It uses the code from this example to restrict the row reorder capability to the columns without the checkbox.
https://datatables.net/extensions/rowreorder/examples/initialisation/restrictedOrdering.html
It uses
rowReorder.dataSrc
to set the data source to the column the sequence number is in.If you continue to have problems please update my example or post a test case replicating the issue with your data.
Kevin