Ensure row to be visible
Ensure row to be visible
balthazarl
Posts: 5Questions: 1Answers: 0
Hi,
how can I ensure n-th row to be visible, just after initializiusing with .DataTable(), with a client side method ?
Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I've tried with the following :
but fnSettings is unknown.
I
Tried MaintainScrollPositionOnPostback="true"
but it's not what I want to do, and afterMyTable.DataTable()
the scroll position is not maintained.I've used the jumptodata plug for this in the past.
https://www.datatables.net/plug-ins/api/page.jumpToData()
Thanks glenderson,
This is not exactly what I want to do.
Yes, It goes to the good row but displays only the selected row and the followings, not the previous.
I Tried ScrollTo from DataTables but without any success.
I Tried
MaintainScrollPositionOnPostBack
but without any success.JumpToData should have repaginated if the pages changed. I then add a jquery scrollTo to bring the row into view. But, the plugin does appear to be based upon content instead of a selector. I would like to select by rowID.
Using dataTables scrollTo seems to work only if you have scrollX implemented also, which I don't. I tried to use it but was thrown errors around lines 450 of the plugin which I assume was because I didn't have scrollbody defined because no scrollX (just a guess).
I was looking at https://www.datatables.net/plug-ins/api/row().show() as a possible starting point for a solution and modifying it to do all the separate actions that I normally do (change page, scroll into view, highlight row). If the page changes, making the selected row appear at the "x" row would be a nice option.
Maybe someone already has something that does it or it's already part of dataTables. It does so many things already.
Thanks glenderson.
I'm on holidays for a week, I will try something with .row() when return .