user1063963
user1063963

Reputation: 1375

How to change combobox item list depending an others selected value in extjs 4

I have 2 combobox
1. with items ['item1','item2]
2. is empty.

I need to add different list depend on which value from list 1 is selected.

I tried to create 2 arraystore and bind them to list2 on list1 select event it is working fine if add id to list 2 (to be able to use Ext.getCmp).
However : i used these element in an ext window and after close it, it cant be reopened because of list2 id will be duplicated.. (the window suppose to be an 'add new user popup', so thats a problem).

I need a way either get rid of the duplicated id. (I tried remove all window element with no luck)
Or be able to replace the list items. May be with some parameterized store?

Upvotes: 1

Views: 612

Answers (1)

JamesHalsall
JamesHalsall

Reputation: 13475

Make sure your window config has

closeAction: 'destroy'

and then as a precaution you can delete the combo before the window is closed by tweaking your listeners config on the window:

listeners: {
    'beforeclose' : function() {
        Ext.getCmp('idOfCombo').destroy();
    }
}

Upvotes: 1

Related Questions