Selected row information when using Edit button to open Editor dialog?
Selected row information when using Edit button to open Editor dialog?
STScI WASABI Team
Posts: 6Questions: 3Answers: 0
Is it possible to get selected row information when you use the edit button to open the editor dialog? I would like to customize the title of the dialog with information from the row; currently I do this thru click handlers:
$('#the-table tbody').on( 'click', 'tr td.cell-being-clicked', function () {
var rowId = $(this).closest('tr').find(".the-row-id").html();
editor
.title( 'Edit ' + rowId + ' Values')
.buttons( 'Update' )
.edit( $(this).closest('tr') );
});
If I can get row information I can use the open event instead to set the title for all editor dialog calls.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Yes - the
ids()
method can be used in combination with DataTables'row().data()
method:Regards,
Allan
Here is a custom button for editing that you can customize whichever way you like. I customized the title but you can also customize the button label and other things.
Just saw Allan's reply: His suggestion is probably better provided you are using Editor 1.7.4 and newer which I don't. My solution also works with older Editor versions.
thanks for the custom button example!