How can i edit multiple rows together
How can i edit multiple rows together
var commentEditor = new $.fn.dataTable.Editor({
ajax: "../../ajax/at/issueLog/issueLog.php",
table: "#defectLogTable",
fields: [
{
label: 'Comment',
name: 'comment'
},
],
formOptions: {
main: {
scope: 'cell',
onBackground: 'none',
onBlur: 'none',
onEsc: false,
drawType: 'none'
}
}
});
editor.on('onClose', function (e, json, data, action) {
commentEditor
.title('Please add a comment for the changes you have made.')
.buttons('Save')
.create();
return false;
});
What i want is when i edit multiple rows together and press Update the comment editor should open automatically where same comment is added to all the rows that were selected.
Thanks
Answers
How have you got the route selection in the DataTables configured? As you'll see in this example multi role selection and editing is available by defiant in Editor.
Allan
... and do you want the comment to be applied automatically as part of the save, or do you want the Editor form to open with the pre-set comment in place.
Colin
No what i want is when i edit multiple row( which are editable) and press Update, another editor should open which is comment Editor and you can manually add a comment that goes in all the rows.
The problem here is it should edit the row but it is creating it causing a issue.
i..e The action is create instead of edit
I need to confirm my understanding here. You want to open another Editor, after you have multi-row edited the table, which would perform another edit on that same table and the same rows? Can you not just add the "Comments" field to the main Editor if that is the case?
Allan
I included the rows and got what i was looking for