简体   繁体   English

extjs网格中每个组合框的条件值

[英]conditional values for each combobox in extjs grid

I have a EditorGridPanel which contains two columns, country and state, each being implemented as a combobox. 我有一个EditorGridPanel,它包含两个列,country和state,每个列都被实现为一个组合框。 User can add as many rows as he/she wants. 用户可以根据需要添加任意数量的行。 I have a list of countries and cities in in the corresponding stores and everything is working fine now. 我有相应商店的国家和城市列表,现在一切正常。 I want to add one enhancement to it for which i need some help. 我想为它添加一个增强功能,我需要一些帮助。 Currently i am loading all the cities in the combobox, instead of that, i want to load only the cities from selected country. 目前我正在加载组合框中的所有城市,而不是那个,我想只加载来自所选国家/地区的城市。 I cant think of a way to do this, appreciate your help 我想不出办法做到这一点,感谢你的帮助

You should modify state's store after you select some country in the first list. 在第一个列表中选择某个国家/地区后,您应该修改州的商店。 For example try to subscribe on the beforeedit event of the grid editor plugin and load only states you want. 例如,尝试订阅网格编辑器插件的beforeedit事件,并仅加载所需的状态。

You could access editor of the column using: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.column.Column-method-getEditor 您可以使用以下命令访问该列的编辑器: http//docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.column.Column-method-getEditor

And here is the event I mentioned: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.plugin.CellEditing-event-beforeedit 以下是我提到的事件: http//docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.plugin.CellEditing-event-beforeedit

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM