Accessing the row_id in the Edit dialogue
Accessing the row_id in the Edit dialogue
Is there a place to look up the DT_RowID once in the Edit dialogue, through a data() call or other ? I don't seem to be able to find it digging for data, but seems I may have missed it ?
Sorry for the basic question. Banging head on this one.
Sorry for the basic question. Banging head on this one.
This discussion has been closed.
Replies
fnGetData would take a single parameter - the row node ( `tr` element) that is being edited and give you back the original data source object so you could do: `table.fnGetData( row ).DT_RowId` .
Where are you trying to get this information? Is it when the edit is first shown (in which case onCreateEdit event might be useful?).
Regards,
Allan
I actually want to access it in the onOpen() call back, but it isn't passed any data. What I ended up doing is set up a virtual accessor like "readonly_rowID" as a hidden type and query that in the onOpen callback - but this seems like perhaps is the wrong way. However, the workaround is working :)
I don't actually see an onCreateEdit method anywhere in the docs or really on google??
Oops sorry - I mixed up the event names. I meant to say onInitEdit - https://editor.datatables.net/api/#onInitEdit . The 1.2.4 update to Editor passes in the row being edited and the data for the row to this event for easier access.
Allan
Cheers!