fnCallback in fnReloadAjax doesn't work

fnCallback in fnReloadAjax doesn't work

janvjanv Posts: 5Questions: 0Answers: 0
edited February 2011 in General
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

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Not quite - you don't need to pass in oSettings - that is done by DataTables automatically. From the documentation "Please note that DataTables will automatically pass the settings object as the first parameter. As such, you do not need to pass the settings object, which you will see if you look at the plug-in API's code."

    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
This discussion has been closed.