PDA

View Full Version : Grid Panel ComboBox Renderer Store



azinyama
25 Aug 2012, 11:45 AM
Hi all!!!

I have a editable combobox in a grid panel. I am using the code below to solve the problem of the displayField not being show:



{
text : 'Category',
id : 'ProviderCategory_ComboBox',
flex : 1,
sortable : false,
hideable : false,
dataIndex : 'Category_RowID',
editor : {
xtype : 'combobox',
typeAhead : true,
selectOnTab : true,
lazyRender : true,
triggerAction : 'all',
listClass : 'x-combo-list-small',
queryMode : 'local',
store : 'ProviderCategory',
valueField : 'Category_RowID',
displayField : 'Category_Descr'
},
renderer : function(value, metaData, record, rowIndex, colIndex, store, view)
{
var categories = Ext.getStore('ProviderCategory');
var catRecord = categories.findRecord('Category_RowID', value);

return catRecord ? catRecord.get('Category_Descr'): '';
}
}


The renderer passes the grid store to the function. My question is: Is there a way of passing the editors store to the function without having to use:


var categories = Ext.getStore('ProviderCategory');

to get the store???

scottmartin
25 Aug 2012, 2:57 PM
You want to pass the combo store to the renderer function? Is there a problem with your current approach?

Scott.

azinyama
26 Aug 2012, 12:45 PM
Nothing wrong with the current approach. Just was wondering if it was possible to pass the combobox store to the renderer and not have to call it again, since the render is for the combobox, just thought it would be nice if the combox store was passed to it automatically.