Results 1 to 3 of 3

Thread: Tpl content not generated in Panel

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    126
    Vote Rating
    0
      0  

    Default Tpl content not generated in Panel

    Ext Version
    Whatever used in the API Documentation. I use 4.1.1

    Browser
    Chrome 23

    Description
    Content area of panel does not render the tpl

    Steps to reproduces problem
    Create panel. Add tpl config

    Expected Result
    html in tpl should be generated inside panel

    Result that occured:
    Panel without any tpl content

    Test Case
    http://docs.sencha.com/ext-js/4-1/#!...Panel-cfg-data
    Code used from first sample in docs. Replace code with the one below.

    Code:
    Ext.create('Ext.panel.Panel', {
        title: 'Hello',
        width: 200,
        height : 200,
        tpl : new Ext.XTemplate('<div>','<p>I should see this</p>','</div>'),
        renderTo: Ext.getBody()
    });

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,434
    Vote Rating
    859
      1  

    Default

    This isn't a bug, the tpl expects some data it can insert into it. Otherwise, it's not dynamic and you can just use the html config:

    Code:
    Ext.onReady(function() {
        Ext.create('Ext.panel.Panel', {
            title: 'Hello',
            width: 200,
            height: 200,
            data: {},
            tpl: new Ext.XTemplate('<div>', '<p>I should see this</p>', '</div>'),
            renderTo: Ext.getBody()
        });
    });
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Posts
    126
    Vote Rating
    0
      0  

    Default

    Alright. My bad . I'll post this as a comment in the documentation for future users.
    Thanks

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
  •