我有自定义搜索表单的kendo网格 . 在我的搜索表单中,我有提交和重置按钮 . 如果搜索某些内容,则网格将使用搜索的过滤器数据源进行更新,然后单击“重置”,网格将使用新数据源进行刷新 . 我的问题是没有重置如果我将pagesize值10更改为20并且我点击重置网格..然后网格pagesize变为20到10 ...如果我点击下一页然后页面大小保持20为第二页,10为第一页
我该如何解决这个问题?任何的想法 ?我的可分页代码:
pageable: {
pageSizes: [10,20, 30, 50],
buttonCount: 5,
messages: {
itemsPerPage: "Items per page",
first: "First",
previous: "Prev",
next: "Next",
last: "Last",
}
},
2 回答
我的理解是,现在你是Grid绑定的changing the Kendo UI DataSource instance . 如果是这种情况,那么您有两种选择:
而不是更改dataSource实例,只使用data()方法更改current dataSource instance中的数据 . 您可能还需要clear the filter programmatically .
如果您希望更改DataSource实例,则从旧实例更新obtain the page size并更新新DataSource实例的set it to be the same in the settings .
正如dimodi所述
您可能需要清除过滤器并设置pageSize
例: