How to scroll to the new added row?
How to scroll to the new added row?
Good Day!
I am new to DataTables and following this example http://datatables.net/blog/Inline_editing
When I add lots of rows already a scroll will appear and every time I add a new row it will add at the bottom which is what I like but
the problem is it will not be shown. Any inputs would be appreciated.
I am new to DataTables and following this example http://datatables.net/blog/Inline_editing
When I add lots of rows already a scroll will appear and every time I add a new row it will add at the bottom which is what I like but
the problem is it will not be shown. Any inputs would be appreciated.
This discussion has been closed.
Replies
A more robust solution is to get the position of the newly added row in the table (in pixel terms) - this you would do by letting the table draw and then using the jQuery position method to get the position and then scroll to that point.
Allan
Can you please give an example on how to get the scroll position and then after refreshing the table set the scroll postion using jQuery postion method?
Thanks in Advance!
$('html,body').animate({scrollTop: $("#id_of_your_table_or_wathever").offset().top},300);
Hope it will help u ;)