draw/page events on datatables 1.10
draw/page events on datatables 1.10
RagingTroll
Posts: 34Questions: 3Answers: 0
Hello, I've been playing around with the new 1.10 version, but i just can't seem to bind some code on the draw/page event like it used to work in the older versions.
This is what I've tried that doesn't work:
[code]$(dt.api().settings()[0].oInstance).on('draw', function () { // tried with 'page' as well..though i get some events working.. like 'sort'
alert('hello');
});[/code]
[code]dt.api().settings()[0].aoDrawCallback.push({
'fn': function () {
alert('hello');
},
'sName': 'hello'
});[/code]
[code]dt.on('draw', function () {
alert('hello');
});[/code]
None of these work. Is where some way to run code on these events from a plugin (not by passing it in the initialization by using fn)?
I need this so that I can add custom filter elements to the table.
This is what I've tried that doesn't work:
[code]$(dt.api().settings()[0].oInstance).on('draw', function () { // tried with 'page' as well..though i get some events working.. like 'sort'
alert('hello');
});[/code]
[code]dt.api().settings()[0].aoDrawCallback.push({
'fn': function () {
alert('hello');
},
'sName': 'hello'
});[/code]
[code]dt.on('draw', function () {
alert('hello');
});[/code]
None of these work. Is where some way to run code on these events from a plugin (not by passing it in the initialization by using fn)?
I need this so that I can add custom filter elements to the table.
This discussion has been closed.
Replies
This will all be int he documentation once its written!
Allan