I've a class inherit from Ext.grid.Panel
and using a method inside this class to display a panel
which includes two items: a listtoolbar
class and a Ext.XTemplate
staff.
Ext.define('MyApp.view.BGrid', {
extend: 'MyApp.view.AGrid', //This class extends from 'Ext.grid.Panel'
requires: [
...
'Ext.layout.container.VBox',
'MyApp.view.base.ListToolbar'
],
getDashBoardTpl: function () {
var me = this;
return [
{
xtype: 'panel',
// html: 'so what?', // Displays the text; See -Img 01
// html: me.dashTpl(), // Displays as [object object]; See -Img 02
layout: {type: 'vbox', align: 'stretch', pack: 'center'},
items:
[
{
xtype: 'listtoolbar', //Display nothing!
flex: 1
},
{
xtype: 'panel',
name: 'dashtpl',
flex: 1,
// html: 'so WHat?' //Display nothing!
html: me.dashTpl() //Display nothing!
}
]
}
]
},
It can not displaying panel's items; listtoolbar
and dashtpl
's html. instead of that it works when the html
tag is using upper panel. Just the thing is displays [Object] [Object]
when dashTpl
function used in first panel.
Here is dashTpl();
dashTpl: function(){
var tpl= new Ext.XTemplate(
'<tpl for=".">' +
'<div class="dashTpl">'+
'<table style="width:100%;height:80px;text-align:center" >'+
'<tr style="width:100%;">'+
'<td style="box-shadow: 10px 5px 5px #BDBDBD;background-color:#EEEEEE;width:20%">'+
'<a>'+
'<span style="font-size:24px;"><b style="color: #8000FF;">5,875.00</b></span><br/>'+
'<div>'+
'<b style="color: #6E6E6E;font-size:14px;">€</b>' +
What could be the reason for this? Thanks in advice.
@Nuri, In your code you are setting
html
usingExt.XTemplate
inside ofpanel
, this is not right way to usehtml
config.In this FIDDLE, I have created a demo using same as mentioned above. I hope this will help you or guide you to achieve your requirement.
CODE SNIPPET