Select Last Inserted Row, Table Desc Order
Select Last Inserted Row, Table Desc Order
vincmeister
Posts: 136Questions: 36Answers: 4
in Select
Hi Allan,
I want to select last inserted row on post submit, but no luck.
My table is ordered by tr_in_id
DESC
I'm using this code, but it select the 1st tr_in_id
I'm changing to :first
, the selection result also same
trReceivingHeadEditor.on('postSubmit', function( e, json, data, action ) {
trReceivingHeadTable.rows(':last').select()
});
Please advise, thank you
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
What I do is flag the new row created using a class. I can then get the row easily. and remove the class if need be.
:last
as a selector would only work if it is inserted into the last position in the table. Perhaps a better option would be to select by id, which you should have access to in thejson
response.Allan