How to get row data once I change the number of entries per page from the combo box ?
How to get row data once I change the number of entries per page from the combo box ?
Hi All,
Using the below code I can able to fetch the row data once I click on pagination button. Like the same way I need to get the data once I change the show entry from the top left combo box.
$('.paginate_button', this.api().table().container()).on('click', function(){
var data = table.rows({ page: 'current' }).data();
console.log(data)
});
For example, In the first case we are showing the 10 entries per page, then I'm going to change it to 25 entries per page. Here when I change the value from 10 to 25 I need to get the data of 25 rows.
Thank you.
Answers
Hi @mallikpk4u ,
Because you're listening for the
click
on the page button, it will still be the old size - you would be better using the DataTables events, such aslength
,Cheers,
Colin
That worked, Thanks a lot Colin