Open editor instance of a specific row by its id
Open editor instance of a specific row by its id
I would like to edit a specific row (by calling a javascript function) based on its id.
Documentation give as an example of the row_selector
option :
var table = $('#example').DataTable();
var row = table.row('#row-42');
Which actually doesn't work on my page.
I thought editiing it by adding :
editor.edit(row);
Having a look at the data retrieved from the server, it looks like the following:
{data: [{DT_RowId: "row_42",…}], options: {,…}, files: []}
data:[{DT_RowId: "row_42",…}]
files :[]
options :{,…}
which looks strange to me since the id format is not the same. Am I missing something?
EDIT Sorry about the spamming, the forum looks a bit tricky today ...
This question has an accepted answers - jump to answer
Answers
Yeah - having issues with the forum software update. Its not going as smoothly as I expected - sorry!
The
edit()
method will accept arow-selector
as the first argument - so you could just use:Another option would be to use:
Allan
That's really strange, I just tried :
whereas:
Maybe it's my setup which is wrong
PS: good luck with the forum
Sorry - I see in your original post you did have an underscore. It should match whatever the id in your table is. Both are valid ids.
Allan
But isn't the id format determined by Datatables? It looked strange that infact my data displayed differently of the normal behaviour
The
row_
prefix is added by Editor's server-side libraries by default. I just had a typo in my original reply, I should have had an underscore. Unless there is a bigger issue?Allan
Perfectly clear thanks