Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-5953 in a recent build.
  1. #1
    Touch Premium Member liuxing_sc's Avatar
    Join Date
    Aug 2011
    Location
    China
    Posts
    38
    Vote Rating
    0
    liuxing_sc is on a distinguished road

      0  

    Default 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.
    PHP Code:
    var template2 '<tpl ...>...</tpl>';
    var 
    grid = {
    ...
    columns:[

    {...,
    tpl:template2}

    ...]

    it's ok in 4.0.7, when it comes to 4.1 RC2 RC3 , it's broken, there's no reaction when record changed

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,146
    Vote Rating
    673
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Test case?

    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);
    
    });
    Changes as I would expect.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Touch Premium Member liuxing_sc's Avatar
    Join Date
    Aug 2011
    Location
    China
    Posts
    38
    Vote Rating
    0
    liuxing_sc is on a distinguished road

      0  

    Default


    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', {
            
    storestore,
            
    renderTodocument.body,
            
    width300,
            
    height100,
            
    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);


    }); 

Thread Participants: 1