-
28 Dec 2012 6:27 AM #1
Unanswered: Regarding tpl button eventhndler
Unanswered: Regarding tpl button eventhndler
Hi,
i am shivanad tripathi new in extjs i have one template which have to button edit and delete and i am using html code for creating button but i want that button on controller so how to get that button on controller based on button id .
i am sending my screen shot and code also.
tpl : new Ext.XTemplate(
'<tpl for=".">',
'<div class="thumb-wrap">',
'<div class="thumb">',
(!Ext.isIE6
? '<img src="http://192.168.1.229/mailtrack-svc/service/image-service/getImageData/template/{name}" height="90" width="90" />'
: '<div style="filter:progid
XImageTransform.Microsoft.AlphaImageLoader(src=\'http://localhost/mailtrack-svc/service/image-service/getImageData/template/{name}\')"></div>'),
'</div>', '<span><input type=button value=Edit onclick="Editbutton" id="Editbutton">       </span>', '<span><input type=button value=Delete>  </span>', '</div>', '</tpl>'),
handler: function(values) {
var id = Ext.id();
alert("idclcik"+id);
Ext.Function.defer(this.addListener, 1, this, [id])
return id;
},
listener: function() {
Ext.getCmp('Editbutton').on('click',function(){
alert("editclcik");
});
}
Thanks&Regards,
Shivanand
});
var categoriesList = Ext.create('lib.Commons.Components.Containers.MailTrackFieldSet',{
border:false,
items : [
Categories
],
});
-
31 Dec 2012 7:10 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
- Answers
- 3107
You have to add element listeners to it...
Code:view.el.on('click', someFunction, view, { delegate : 'button' });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.






Reply With Quote