javascript - Increasing pagesize on expanding the kendo grid -


i have kendogrid thousands of records. want show grid in shrinked view 5 items in grid on dashboard expand button on grid. when user click on expand button items in grid should increased 20.

for expanding grid on dashboard using below code:

function expand(widgetname, speed) {         var widget = $("#" + widgetname + "widget");         debugger;         var gridname = widgetname + "grid";         gridname.data().kendogrid.datasource.page(20);         widget.css({ "z-index": 100 });         getwidget(widgetname).expanded = true;         var expandedheight = getexpandedheight(widgetname);         widget.animate(             {                 top: '5',                 height: expandedheight             },             speed,             function () {                 // animation complete.                 var grid = $("#" + widgetname + "grid");                 if (grid.length > 0) {                     grid.animate(                         { height: expandedheight - 70 },                         speed / 3,                         function () {                             resizegrid(grid);                         }                     );                 }             }         );     }` 

you use pagesize method , call .read() again, such as:

gridname.data().kendogrid.datasource.pagesize(20); gridname.data().kendogrid.datasource.read(); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -