PDA

View Full Version : Combobox fire event



Pravin.Pawar
11 Dec 2012, 1:04 AM
Hi,

I have used multiple combo box over the UI whose values are dependent on each other. Based on users selection ; I'm populating values in the combo box and it works fine.

e.g. 1. cboGroups => GroupList
2. cboApplications => ApplicationList

In the above example; when user select particular group then I'm populating applications within cboApplications combo box.

listeners: {
'select': function (cmb, record, idx) {
cboApplications.bindStore(store)

Now my question is how should I bind applications combo box when I'm reading and displaying data from DB. I mean; when I open dialog window then I fetch record from the Database and I get GroupID along with ApplicationID... now I want to bind application combo with GroupID related values.

One way is; we need to call select event of the group; so that it will take care of filling the application combo box as I have placed application binding code within the listeners: 'select' OR i will need to call ApplicationsStore when I will set Groups value.

Sorry for writing huge lines; but I hope you are clear what I'm looking for... please suggest me better solution

mitchellsimoens
12 Dec 2012, 2:28 PM
I'm sorry, I think this went right over my head. So you have two combos, one for group and one for applications. When you select from group you want to populate the application combo?

Pravin.Pawar
14 Dec 2012, 4:51 AM
I could able to resolve issue by using following code-

var cmbApplication= Ext.getCmp("cbApplication");
cmbApplication.clearValue();
cmbApplication.bindStore(AD.Master.DataStore.GetApplicationsByGroupStore(groupid));

where AD.Master.DataStore.GetApplicationsByGroupStore(groupid) fetches data in store from AJAX request.