Select New Row in Table.

Select New Row in Table.

andrew beeverandrew beever Posts: 12Questions: 6Answers: 0

I would like to select the new row in I’ve added using editor.create in the table

When the create method has been successfully submitted and the new row added to the associated table the new row is highlighted momentarily.

I’ve tried to use drawCallback and table.on(‘draw’, function… both, as per the documentation fire before the new row is highlighted momentarily.

Is there a way in the editor submit method to leave the new row highlight on rather than it being on a timeout?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,682Questions: 1Answers: 10,498 Site admin
    Answer ✓

    postCreate is the event to listen for here and then use row().select() on the row that was created - e.g.:

    editor.on('postCreate', function (e, json, data, id) {
      table.row('#' + id).select();
    });
    

    Allan

  • andrew beeverandrew beever Posts: 12Questions: 6Answers: 0

    Thank you Allan!!

Sign In or Register to comment.