Results 1 to 2 of 2

Thread: XTemplate not rendering more than once - ExtJS

  1. #1
    Sencha Premium Member
    Join Date
    May 2013
    Posts
    22
    Vote Rating
    0
      0  

    Default 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
    6,154
    Answers
    501
    Vote Rating
    249
      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 human resources manager: fabienne.bell@sencha.com

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •