datatable changing per page size dynamically

Hi,

I’m trying to change the datatable count per page with a drop down.

This is what i’m doing:

$(".dt_resize").on(“change”,function(){
dtable.getPager().config.size = $(this).val();
dtable.refresh()
});

at first it works, but i notice that the count size doesn’t get updated across all the pages. let’s say i start out with just 2 rows per page, i change to 3, then 4, then change back to 2 and then i click on the second page – the second page would display all the prefetched rows instead of just 2 it has been set to.

Above code is correct.
Just be sure that “size” value is a number

dtable.getPager().config.size = $(this).val()*1; //force number

http://webix.com/snippet/58e768a0

how can i chnage the records in datatable using pager itself.I need to get selected number of records displayed in datatable

You can use api of datatable to get info about selection state.

http://docs.webix.com/datatable__selection.html