View Full Version : Change proxy store combo

2 Oct 2009, 2:17 AM

I have an editable grid. In the grid are rows of users, like username, password, etc. There is also a column 'group'. When the user begins to edit a 'user-row', the user can change the value of 'group' in a combobox.

This combobox has a local store, which has autoLoad:true. The store loads via HttpProxy a certain amount of data into the combobox.

The problem is, the record of the grid selection isn't available in the combobox' store, so when editing it shows the id (valueField) and not the groupname (displayfield).

So, for example, if the edit button is clicked:

Combobox store records:

*id: 1, name: 'Joep'
*id: 2, name: 'Bill'
*id: 3, name: 'Michael'

Grid selected record:

*user: 'test'
*pass: 'test'
*group_id: 5 (<<<< Combobox valueField)

So the name record with id 5 and a name must come from somewhere. I tried to send the group_id in a GET with the combobox store proxy (so i can get the name for the id 5) and reload the store. This worked, but the name (displayField instead of valueField) didn't show until i opened the combobox.

What happened was this:

* store is loaded
* Edit button is clicked
* In button edit click event, change proxy url and reload store
* Combobox is shown with valueField (number and not a name)
* Store is updated

So when i opened the combox it had the correct store records... but too late.

Hope someone understands my problem, it's quite difficult to explain. :(