I want to edit a column value for multiple rows using datatables.
I want to edit a column value for multiple rows using datatables.
Sohaib Ahmad
Posts: 15Questions: 5Answers: 0
I've rendered the checkbox using render function like this
render: function(data){
var html = '';
if(options.check)
html = '<input type="checkbox" class="cx-action ' + options.checkClass + '" data-id="' + data +'">\n';
return html;
}
Don't know what to do next to update the records.
Pardon any mistakes. I'm new here.
Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Please provide more details about what you mean when you say "update the records".
Kevin
Like when i select multiple rows using checkboxes, I want to set or update a column value for all the selected rows.
Thanks
Are you using the Select extension?
If so you can use this example for the checkbox selection.
One option to update the selected rows is to use
rows().every()
to loop through all the selected rows. You will use aselector-modifier
of{selected:true}
as shown here to limit the rows to selected rows.Then use
row().data()
to update the row data.Kevin
Thanks for your answer. I'll try with that and let you know.
Regards
I built a quick example:
http://live.datatables.net/vumeqeqi/1/edit
Doesn't have the select checkbox but the behavior is the same.
Kevin
Thanks mate.