KendoUI: resetting grid data to first page after button click

后端 未结 5 1830
心在旅途
心在旅途 2020-12-18 21:29

I have the following scenario:

in my page I have a grid (with pagination) bounded to a datasource. When I click on the button \"Extract\" the grid gets populated (re

5条回答
  •  Happy的楠姐
    2020-12-18 22:02

    Define a parameterMap for your Kendo grid DataSource read operation, this comes into the transport element as shown below. Then call grid.dataSource.page(1), this will call read and you should be sorted.

       new kendo.data.DataSource({      
    transport: {
                       read: {
                              // ur read
                              },
               parameterMap: function (o, operation) {
                             var output = null;
                             switch (operation) {
                                        case "create":
                                        break;
                                    case "read":
                                        output =  {parameter: "value"};
                                        break;
                                    case "update":
                                        break;
                                    case "destroy":
                                        break;
                            }
                         return output;             }}});
    

提交回复
热议问题