如何清除存储并更新分页工具栏?
当我单击搜索按钮重新设置时,我需要将分页工具栏参数重置为 "page"
、"start"
、"limit"
使用不同的参数加载网格存储!
我该怎么做?
问题是,当我在下一页上进行新搜索时,我有参数 page=2
、start=25
、limit= 25 dirty
,相反我需要重置这个参数。
我的代码:
listeners: {
click: function(){
Ext.getCmp('GrlGio').getStore().removeAll();
Ext.getCmp('GrlGio').store.load({
params:{
mode: "RIC",
DataRicerca: dd,
Pit: Ext.getCmp('cmbPiattaforma').getValue()
}
});
}
}
谢谢!
i need to reset paging toolbar parameters as "page"
, "start"
, "limit"
when i click on a search button to re-load grid store with different parametres!
how can i do it?
the problem is that when i am on the next page, and i do a new search, i have the parameters page=2
, start=25
, limit=25 dirty
, instead i need to reset this parametres.
my code:
listeners: {
click: function(){
Ext.getCmp('GrlGio').getStore().removeAll();
Ext.getCmp('GrlGio').store.load({
params:{
mode: "RIC",
DataRicerca: dd,
Pit: Ext.getCmp('cmbPiattaforma').getValue()
}
});
}
}
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
在 Ext 4 中,我发现 loadPage() 非常适合重置数据存储并使分页工具栏返回第一页。例子:
In Ext 4, I found loadPage() worked pretty well for resetting the data store and making the paging toolbar go back to the first page. Example:
为我做了这个伎俩
伙计们 currentPage=1在每次调用下面的命令加载商店之前
顺便说一下,我得到了 500 个结果并加载到缓存中
分页适用于本地,您可以在任何新搜索之前尝试此任何方式
Guys currentPage=1 did the trick for me
before loading the store every time call the below
By the way i am getting 500 results and loading in cache
Pagination is for local, any way you can try this before any new search
您可以手动重置参数
,然后进行存储加载。我知道它看起来是硬编码的,但这是我找到的唯一解决方案......
you can manualy reset the params
and then do the store load. I know it looks hardcoded but it's the only solution i found...
试试这个 -
Try this -
通过覆盖 ext.data.store 定义以下函数“resetStartParam”:
现在单击搜索按钮时调用此函数:
就是这样。它应该可以工作。
Define following function "resetStartParam" , by overriding ext.data.store:
Now call this function on click of your search button:
Thats it.It should work.
我知道这是一篇旧文章,但我想我应该添加我的便士工作。我正在使用 EXTJS 4 并且遇到了类似的问题。当我进行新的搜索时,页码等没有重置。我找到的解决方案似乎可以自动与导航栏一起使用,它是使用商店的 currentPage 属性。我确实有一个稍微奇怪的设置,但是当我进行新搜索时执行 this.currentPage = 1 对我来说效果很好
I know that this is an old post but I thought I'd add in my pennies work. I'm using EXTJS 4 and had a similar problem. When I did a new search the page number etc did not reset. The solution I found, which appears to work with the nav bar automatically is using the currentPage attribute of the store. I do have a slight odd setup but doing this.currentPage = 1 when I do a new search works fine for me
之后在您的处理程序中尝试此操作
,输入您的搜索查询并相应地加载商店
希望它有帮助
try this in your handler
after this, put your search query and load the store accordingly
hope it helps
只需在removeAll()之后调用pagingToolbar.onLoad()即可。简单明了。
just call pagingToolbar.onLoad() after removeAll(). Plain and simple.
下面是我如何通过分页实现搜索。它只执行 1 个请求并刷新分页数据。
getFieldValues() 文档: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.Basic-method-getFieldValues
有关代理“extraParams”的更多信息,请参见此处: ExtJs4 - 存储 baseParams 配置属性?
Here is how I achieved search with paging. It only does 1 request and it refreshes the paging data.
getFieldValues() documentation: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.Basic-method-getFieldValues
For more about the proxy "extraParams" look here: ExtJs4 - Store baseParams config property?
这工作正常(正确刷新分页信息):
This work fine (refresh correctly the paging info):
必须将页面大小更改为 500 才能打印整个商店/网格,打印后,将网格恢复到原始页面大小 25。
解决办法 - 使用相同的排序器/过滤器/currentPage 重新加载商店
Had to change the page size to 500 for printing the WHOLE store/grid, and once printed, restore the grid to the original page size of 25.
does the trick - reloads store with the same sorters/filters/currentPage