0
votes

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

1
There is only one combobox showing. Do you mean, that you need to set the value of row 2, val 2? So that val 2 will be blank? - Gašper
Yes, i want make ro2 val2 blank. Can you point me how do that? - frank
If I understood well, you better want to edit the 2nd record (not combo component) of the store when you edit the first one. When you clear the col2 value of row2 record the editor combo will be cleared as well (on next show). - Federico Baron

1 Answers

2
votes

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, "")