简体   繁体   中英

clear combobox value inside grid extjs

I have a grid with to columns. The second column has editor with xtype: combobox. So here is my 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. 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:

If you know the second row 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, "")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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