Switch to specific page dynamically

Switch to specific page dynamically

hawkmasterhawkmaster Posts: 56Questions: 20Answers: 0

Hello,
Follwing situation:
my datatable shows 5 rows per default. If user switch to show 50 entries, the table will become higher.
The user selects row 20.

Now I want that the table switch back to "Show entries" 5 but shows the selected row.
I tried it as below. The switching back to DisplayLength 5 works fine, but now I can not longer see the selected row 20.
So I tried it with fnPageChange(4). I thougth this will switch to page 4 (as you click manually on Next button)

But nothing happens.
Can somebody help me with that problem?
..
var rowindex = $(this).parent('tr').index();
var oSettings = oProjectTable.fnSettings();
oSettings._iDisplayLength = 5;
//tableInfo.page(4);
oProjectTable.fnPageChange(4);
oProjectTable.fnDraw();

thanks a lot
best regards
Hawk

This discussion has been closed.