Problem getting the correct number of rows for datatable

Problem getting the correct number of rows for datatable

kvn9328kvn9328 Posts: 18Questions: 7Answers: 0

Hi,

I am using the following:


var table = $("#pagination").DataTable(); $("#btnSearch").click(function(){ var drawTable = table.draw(); var data = drawTable.data().length; if(data == 1){ var payload = drawTable.row(0).data(); var id = payload.Id; window.location.href = 'view.html?id='+id; } });

So, the problem i am facing here is the number of rows that i am being returned is from the previous draw.

So how would i get the row count for the current draw?

Thanks!

This discussion has been closed.