I have a grid with some store, assigned to it and with combobox as column editor (with another store for values). In order to display correct value in a grid I'm using custom renderer, and in this renderer I need access to combobox's store - and that's the problem.
I see two possible ways:
- somehow to put this store to grid from controller;
- get store from combobox.
Unfortunately, I couldn't find solution for none of them. Can you help me? Thank you in advance.
Current renderer code which currently doesn't solve my problem (need to be remade in order to get title from store)
var comboRenderer = function(value, metaData, record, rowIndex, colIndex, store, view) {
var combo = this.down('#typeCombo');
if (combo) {
var record = combo.findRecord('name', value);
return record.get('title');
} else {
return value;
}
};
UPD: new renderer, working:
var comboRenderer = function(value, metaData, record, rowIndex, colIndex, store, view) {
var types_store = Ext.getStore('comboStore');
var index = types_store.findExact('name', value.toString());
if (index != -1) {
return types_store.getAt(index).get('title');
} else {
return value;
}
};