fnCallback in fnReloadAjax doesn't work
fnCallback in fnReloadAjax doesn't work
In a dataTable I made a custom column with 'delete' buttons.
I register an event for them in the
[code]
"fnInitComplete": function() {
regVerwijderKnoppen()
}
[/code]
The function regVerwijderKnoppen takes care of the registration:
[code]
function regVerwijderKnoppen(){
console.log("number of buttons" + oTable.fnGetNodes().length)
$('button',oTable.fnGetNodes()).click(function(){
verwijderRecord(this.id); //functie
})
}
[/code]
The function verwijderRecord takes care of the actual deletion of the record.
When I use fnReloadAjax after a deletion, my buttons cease to work, but I tried to re-register them by using the fnCallback option in fnReloadAjax.
For some reason that doesn't work. Is this the correct syntax for fnReloadAjax?
[code]fnReloadAjax(null,null,regVerwijderKnoppen,null)[/code]
thanks for any suggestions,
Jan
I register an event for them in the
[code]
"fnInitComplete": function() {
regVerwijderKnoppen()
}
[/code]
The function regVerwijderKnoppen takes care of the registration:
[code]
function regVerwijderKnoppen(){
console.log("number of buttons" + oTable.fnGetNodes().length)
$('button',oTable.fnGetNodes()).click(function(){
verwijderRecord(this.id); //functie
})
}
[/code]
The function verwijderRecord takes care of the actual deletion of the record.
When I use fnReloadAjax after a deletion, my buttons cease to work, but I tried to re-register them by using the fnCallback option in fnReloadAjax.
For some reason that doesn't work. Is this the correct syntax for fnReloadAjax?
[code]fnReloadAjax(null,null,regVerwijderKnoppen,null)[/code]
thanks for any suggestions,
Jan
This discussion has been closed.
Replies
So just remove the first null in your call and that should do it. You also need to call oTable.fnReloadAjax - just incase you aren't already :-)
Allan