PDA

View Full Version : column renderer with data from separate store - out of sync



agony
10 Dec 2014, 7:15 AM
this is a renderer for a gridpanel column


renderer: function(v){
var index = this.resellerStore.findExact('id',v);
var rec = this.resellerStore.getAt(index);
return rec.get('name');
},


Problem is that the store for the data loads after it tries to access it, giving undefined errors.

I need the renderer to display the name value in the grid based of the id value in grid ( that gets set by roweditors combobox - or from grids own store).

Any ideas how to solve this?

I tried :


this.resellerStore.load({
scope: this,
callback: function(records, operation, success) {
if (success) {
this.store.load();
}
}
});

But it still end up giving undefined errors in renderer.

lumberjack
16 Dec 2014, 7:38 AM
I'd like to test this along with you. Can you post a simple test case either inline here or at https://fiddle.sencha.com?


Regards,
Brian

agony
17 Dec 2014, 12:31 AM
Let me recall what i did there,,Apparently the store loaded after the render (even if the main grid store load was inside a callback).I end up adding the data to the main store in back end and called it with r.get on renderer.