-
22 Nov 2012 10:26 PM #1
Tpl content not generated in Panel
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() });
-
22 Nov 2012 10:42 PM #2
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!
-
22 Nov 2012 11:08 PM #3
Alright. My bad
. I'll post this as a comment in the documentation for future users.
Thanks
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote