Ardit Meti Ardit Meti - 1 year ago 73
Javascript Question

How to select the corresponding page of row datatable

I want to preselect a row in my datatable and I am using the

function for that. It does select the row but it doesn't select the corresponding page where that row is.
I know there exists an option displayStart:

$('#example').dataTable( {
"displayStart": 20
} );

to start on a specific page, but it requires the number of the row in the source list not the id of that row.
Is there a way how to initialize the page using the rowID?

EDIT: The data is taken from the server, not in client.

Answer Source

Use row().show() API method to display page containing required row.

Please note that you need to include additional JS file // for this API method to work.


See this example for code and demonstration.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download