简体   繁体   English

清除网格extjs内的组合框值

[英]clear combobox value inside grid extjs

I have a grid with to columns. 我有一个到列的网格。 The second column has editor with xtype: combobox. 第二列具有xtype编辑器:combobox。 So here is my grid: grid 这是我的网格: grid

I want to clear my second row's combobox when first combobox is changed. 我想在更改第一个组合框时清除第二行的组合框。 I tried do this with edit( editor, e, eOpts ) , but i'm a little confusing when i try retrieve second combobox. 我尝试用edit( editor, e, eOpts )做到这一点,但是当我尝试检索第二个组合框时我有点困惑。 Something like this: 像这样:

var combobox1=editor.grid.columns[1].getEditor(e.record, 1)

it gives me current combobox, so i can't take another combo. 它给了我当前的组合框,所以我不能再使用另一个组合框了。 Can you help me, please 你能帮我吗

If you want to make row2 val2 blank, you first have to get the record of the second row from the store, you can do that by: 如果要将row2 val2留为空白,则首先必须从存储中获取第二行的记录,可以通过以下方法实现:

If you know the second row id: 如果您知道第二行ID:

secondRecord = grid.getStore().getById(ROW2_ID)

If you know the row index: 如果您知道行索引:

secondRecord = grid.getStore().getAt(1)

and then you just do 然后你就做

secondRecord.set(VAL2_FIELD_NAME, "")

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

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