1. #1
    Sencha User
    Join Date
    May 2013
    Posts
    22
    Vote Rating
    0
    abram.darnutzer is on a distinguished road

      0  

    Default Unanswered: XTemplate not rendering more than once - ExtJS

    Unanswered: XTemplate not rendering more than once - ExtJS


    I have a View that is using XTemplate.

    extend: 'Ext.view.View', xtype: 'idView', width: 300, itemSelector: 'aside.x-item', loadMask: false, overflowY: 'auto', itemTpl: new Ext.XTemplate( '<tpl for=".">', '<p>{id}</p>', '</tpl>', ),I'm referencing the object in 2 panels. This panel is shown first and it displays the Xtemplate just fine.

    { xtype: 'idView', itemId: 'first-idview', store: 'IDStore', }But on the second panel that I try to use it, nothing shows up. The ExtJS code for it is exactly the same as above. Is there something that I'm missing here?

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,470
    Answers
    442
    Vote Rating
    202
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    The following seems to work ok for me. Am I missing something in the test case?
    *Don't forget to wrap your code in code blocks for readability

    Code:
    Ext.define('MyView', {
        extend: 'Ext.view.View',
        xtype: 'idView',
        width: 300,
        itemSelector: 'aside.x-item',
        loadMask: false,
        overflowY: 'auto',
        itemTpl: new Ext.XTemplate('<tpl for=".">', '<p>{id}</p>', '</tpl>')
    });
    
    
    Ext.create('MyView', {
        renderTo: document.body,
        height: 100, width: 100,
        store: {
            fields: ['id'],
            data: [{
                id: 1
            }, {
                id: 2
            }]
        }
    });
    
    
    Ext.create('MyView', {
        renderTo: document.body,
        height: 100, width: 100,
        store: {
            fields: ['id'],
            data: [{
                id: 1
            }, {
                id: 2
            }]
        }
    });
    Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our recruiting manager: sheryl@sencha.com

Thread Participants: 1

Tags for this Thread