Full Row/ Inline Edit Example
Full Row/ Inline Edit Example
Looking at the example at the bottom here, I can clearly see the inline part and to my understanding, the code
$('#approve').on( 'click', function () {
editor
.edit( false )
.val( 'approved', 1 )
.submit();
} );
works along with this to toggle the value of approved in that row to 1 and then submit the entire tables data.
But your intro partly reads "In this example we create a single Editor instance, which is used for both full row editing of a DataTable and inline editing."
Where is the "full row editing" part here? Is it implicit by clicking the "Edit" button?
This question has an accepted answers - jump to answer
Answers
There is nothing there to tell Editor what it should actually edit. The
edit()
method expects some kind of identifier as the first parameter parameter passed into it (that's how you tell it what row to edit). The example of the docs page you linked to there is wrong I'm afraid - I will correct that forthwith!It should be using:
i.e. get the row indexes for the selected rows, edit them, set their approved flag and submit.
Correct.
edit()
is full row editing, whileinline()
is inline editing.Allan
But you can edit a full row “inline” so what’s the difference? Inline doesn’t necessarily mean single cell editing.
Never mind: inline means single cell inline editing from DT perspective.
Yes - inline just means the display of a single editing field in the table - you can use the API to edit the whole row.
I didn't really have a better term other than "full row" to explain the main editing window!
Allan