Reaching page changed and row number changed callback

Reaching page changed and row number changed callback

markjomarkjo Posts: 66Questions: 0Answers: 0
edited November 2013 in General
I want to trigger 2 actions:
1) when user goes from page 1 to page 2 in table
2) user changes number of rows shown (for example from 25 to 10 or 50)

In my code I get fnDrawCallback like this:
[code] userstable.dataTable(
{
....
"fnDrawCallback": function () { updateTableCallback(); },
....
}[/code]


I saw this answer: http://stackoverflow.com/questions/9536758/datatables-page-change-callback/9538339#9538339
Also this one: http://datatables.net/docs/DataTables/1.9.0/#draw

These solutions proposes bind like this:
[code] (oTable).bind( 'draw', functionName );[/code]
[code] (oTable).bind( 'page', functionName );[/code]

I don't want to make a binding out of the datatable settings constructor. I want to add it as a setting.

Is it possible to add a setting to my datatable and it will only get for page change and row number change ?
In callbacks section there is only fnDrawCallback matches my needs: http://datatables.net/usage/callbacks
Or fnDrawCallback is the only way in settings ?

Thank you.

Replies

This discussion has been closed.