-
13 Apr 2012 8:23 AM #1
Template for grid is not available
Template for grid is not available
hi, i found template do not re render while record changed in grid. we can see this happened all in our project.
it's ok in 4.0.7, when it comes to 4.1 RC2 RC3 , it's broken, there's no reaction when record changedPHP Code:var template2 = '<tpl ...>...</tpl>';
var grid = {
...
columns:[
{...,tpl:template2}
...]
}
-
13 Apr 2012 10:51 PM #2
Test case?
Changes as I would expect.Code:Ext.onReady(function() { var store = Ext.create('Ext.data.Store', { fields: ['name'], data: [{ name: 'Foo' }] }); Ext.create('Ext.grid.Panel', { store: store, renderTo: document.body, width: 300, height: 100, columns: [{ xtype: 'templatecolumn', dataIndex: 'name', text: 'Name', tpl: '<div style="color: red;">{name}</div>' }] }); setTimeout(function(){ store.first().set('name', 'Bar'); }, 1000); });Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
15 Apr 2012 8:52 PM #3
hi, i've tested your case, it's okay, but if you add "IF" tpl statement in it, it worked incorrectly. there's no change at all. try my test case below.
PHP Code:Ext.onReady(function() {
var store = Ext.create('Ext.data.Store', {
fields: ['name'],
data: [{
name: 'Foo',
id:1
}]
});
Ext.create('Ext.grid.Panel', {
store: store,
renderTo: document.body,
width: 300,
height: 100,
columns: [{
xtype: 'templatecolumn',
dataIndex: 'name',
text: 'Name',
tpl: '<tpl if="id==1"><div style="color: red;">aaa{name}</div></tpl><tpl if="id==2"><div style="color: blue;">bbb{name}</div></tpl>'
}]
});
setTimeout(function(){
store.first().set('name', 'Bar');
store.first().set('id', 2);
}, 1000);
});
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-5953
in
4.1.


Reply With Quote