PDA

View Full Version : how to render toolbar in a template



naveen.kumar
5 Jun 2012, 6:54 AM
var rolestpl = new Ext.XTemplate(
'<tpl for=".">',
'<div class="roles">',
'<div class="rolesheading">{rolesHeading} <span>({roleValue})</span></div>',
'<div id="xyz">{[new Ext.ux.toolbar({id:"abc",buttonIcon:"add,import,export"})]}</div>',
'<div class="rolesList">',
'<tpl for="userList">',
'<div>{.}</div>',
'</tpl>',
'</div>',
'</div>',
'</tpl>'
);

this is rendering [object object] in html.how toolbar render in it.

mitchellsimoens
7 Jun 2012, 1:31 PM
May want to look at this: http://skirtlesden.com/ux/ctemplate

sword-it
7 Jun 2012, 11:12 PM
Hi

You can Create the toolbar in any event that you want may be afterRender or any button click


var toolbar = new Ext.Toolbar({
renderTo: 'xyz' //xyz is the id of the element of Template ,where u want this toolbar
, items: [
{
text: 'click me'
}
]
});




var myTpl = new Ext.XTemplate(
'<tpl>',
'<div id="xyz"></div>',
'</tpl>'
);
return myTpl;