extjs 有状态网格删除排序
我对有状态网格有疑问。我不想保存排序状态,但我确实想保存所有其他选项(列位置、列宽度、分组等)。
现在我已经使用 stateEvents 选项尝试过此操作,但当偶数触发时它会保存网格的整个状态。
是否有任何选项可以从保存中排除排序状态?
网格配置的一部分:
this.gridPanel = new Ext.grid.GridPanel({
id:'grid'+this.id,
region:region,
layout:'fit',
stateful:true,
stateEvents: ['columnmove', 'columnresize', 'groupchange', 'bodyresize'],
loadMask:true,
split:true,
store: this.stores['root'+this.id],
cm: this.getRootColumnModel(),
sm: this.getRootSelectionModel(),
I have a problem with statefull grid. I do not want to save the sort state but I do want to save all other options (column position, column width, grouping etc.)
For now I have tried this with stateEvents option, but it saves whole state of grid when the even fires.
Is there any option to exclude sort state from saving??
Part of the grid config:
this.gridPanel = new Ext.grid.GridPanel({
id:'grid'+this.id,
region:region,
layout:'fit',
stateful:true,
stateEvents: ['columnmove', 'columnresize', 'groupchange', 'bodyresize'],
loadMask:true,
split:true,
store: this.stores['root'+this.id],
cm: this.getRootColumnModel(),
sm: this.getRootSelectionModel(),
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以简单地覆盖网格的
applyState
方法(并删除其中的sort
状态):You can simply override grid's
applyState
method (and deletesort
state in it):这不是我的解决方案,似乎来自 Sencha 支持团队,该示例有效。
https://fiddle.sencha.com/#fiddle/dlc
http://www.sencha.com/forum/showthread.php?294920
This is not my solution, appears to have come from the Sencha support team, the example works.
https://fiddle.sencha.com/#fiddle/dlc
http://www.sencha.com/forum/showthread.php?294920