DataTables Editor: fields.data function, can i determine if I am in a multi-edit?
DataTables Editor: fields.data function, can i determine if I am in a multi-edit?
I am using the Select2 plugin, I provide it an object and eventually it does sets the _input.val()
to an int like Department.Id.
However, during multi-edit when DataTables has that "Multiple Values" dialog, it will circumvent the Select2.get code and fire off the ajax call providing the full object like DepartmentId = { Id: 1, Name: "Human Resources" }
. My server breaks expecting an int for DepartmentId.
I realize I can probably access the editor instance to determine this but I want to avoid these global variables as they make refactoring a nightmare.
I see I get data, type, set, and type is "editor", it would be nice to also know if we are dealing with multiple rows. Whats more, in a multi-edit scenario, the function is just called twice. I assume internally DT is using "compare" to figure out if the values are the same.
This question has an accepted answers - jump to answer
Answers
Can I just confirm I've understood correctly:
Thanks,
Allan
Sorry, disregard. I put myself in this spot from modifications I made to the provided Select2 plugin.