Datatables Expand All Rows
Datatables Expand All Rows

Hi All,
I am implementing a expand all Functionality of all rows in datatable. I have the functionality implemented for a each individual row in the datatable with a + sign, when you click there the row expands. each row has a onclick javascript function.
While implementing expand all All the rows in page 1 gets expanded. But on page 2 the rows stay closed. What should i be doing so that the onclick function gets called on page 2 as well. Here is my code for expand all.
jQuery('body').on('click','#ExpandAll ',function(){
var rows = jQuery("#sortable_mappedTable").dataTable();
jQuery.each(rows.fnGetNodes(), function (i, row) {
var id = jQuery(this).find('.dataToggle.dataToggleClosed').trigger("onclick");
});
});
Answers
new page means new objects. you need this code tied to the .draw() event.