insert new row (using the button) and select it and scroll to it
insert new row (using the button) and select it and scroll to it

Hello.
I'm using Editor. I need insert new row (using the button) and select it and scroll to it.
Insert new row and scroll to it I do without problem but I can't select row automatically.
I would be grateful for help
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Not sure exactly how you are finding the row you want. This example of the row().show() plugin may help:
http://live.datatables.net/hatojihe/3/edit
If not then please post some code or better a link to an example of what you are doing.
Kevin
Hi @kthorngren
Thank for your help.
I planned to do it as follows:
1.Insert new row
buttons: [
{ extend: 'create', editor: editor },...
2.Get new row ID and select it
I don't know how do it
3.Scroll to new row
{table.row('.selected').scrollTo()}
Please tell me if this is possible
Yes, it is possible. I put together a simple example to get you started:
http://live.datatables.net/tedabuvo/1/edit
It uses
rows().indexes()
andfilter()
to find the index of the row containing specific text. The select extension is used to select the row and the scroller extension is used to scroll to the row.Kevin
hi @kthorngren.
Thank for your help.
Please tell me if is possible get new row ID without filter() (and passing row values because I have a lot of them)?
Just insert the new row and get its ID.
Looks like the
postCreate
has the row ID if you are using Editor 1.8 or above.Kevin
Hi @kthorngren.
Thank you very mutch.