PDA

View Full Version : Grid Combobox not show loaded data



qnavry
29 Jun 2011, 7:59 AM
In my grid i can add new rows just fine ( combo boxes work), but when I have existing data that is loaded from the DB it does not show the combobox display value until I go into edit mode.

Any Ideas?

i am using this renderer if it matters:


Ext.util.Format.comboRenderer = function (combo) {
return function (value) {
var record = combo.findRecord(combo.valueField || combo.displayField, value);
return record ? record.get(combo.displayField) : combo.valueNotFoundText;
}
}

skirtle
30 Jun 2011, 2:58 PM
Are you preloading the combobox's stores before you try to use the renderer?

vStyle
17 Nov 2011, 7:38 PM
skirtle
How to preload the combobox's stores, is there any sample?

skirtle
18 Nov 2011, 7:21 AM
To preload, try adding autoLoad: true to the store. This will cause it to be loaded as soon as it is created. However, ensuring it has finished loading before you try to use it would rely on you waiting on a suitable event. If you create it when the page first loads then chances are it will be loaded long before it is needed but if you're creating it just before you want to use it then you'd have to wait.

vStyle
18 Nov 2011, 7:27 PM
Thanks skirtle, will try it today.