PDA

View Full Version : Regarding adding button in a template



Sweta Patil
9 Oct 2011, 10:36 PM
I tried the samples given on forum but could not integrate with my code.. Can any one please help me in adding a button in my template along with the other details.... Below is my code..

var productsListC3 = new Ext.DataView({
store: new Ext.data.Store({
model: 'Account_Model',
proxy: {
type: 'ajax',
url : 'test2.json',
reader: {
type: 'json',
root: 'bank3'
}
},
autoLoad : true
}),
tpl: new Ext.XTemplate(
'<table>',
'<tpl for=".">',
'<div class="item">',
'<tr>',
'<FONT SIZE="2">Account number :{account_no}',
'</br>',
'</tr>',
'<tr>',
'<td align="left"> <img src="{url}"/></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{amount}</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<small><FONT SIZE="2">Overdraft Limit : {overdraft_limit} </td>',
'</tr>',
'</div>',
'</tpl>',
'</table>'
),
itemSelector: "div.item",
});

Any help wud b awesome...
thanks in advance.... :)

AndreaCammarata
9 Oct 2011, 11:09 PM
Hi Sweta.
To add a button in yout Template you can simply add to it a new div like follows



'<div class="x-button x-button-action">' +
'<span class="x-button-label">Caption</span>' +
'</div>' +


However, you have to "play" with you app CSS to be able to put it exactly where you want to place it.

Hope this helps.

Sweta Patil
9 Oct 2011, 11:33 PM
thanks a lot andreacammarata .. this really helped me out to get a button in a template.. :)

AndreaCammarata
9 Oct 2011, 11:34 PM
thanks a lot andreacammarata .. this really helped me out to get a button in a template.. :)

You are welcome ;)