-
12 Nov 2012 10:17 PM #1
Unanswered: button in template
Unanswered: button in template
three more days make me to modify this code
but i fail.
and i makeHTML Code:'<tpl if="this.checkValue(values.type)">', + '<dl style="display:inline-block;width:100px;color:red;font-weight:bold;padding-left:20px;">' +'{[values.type.toUpperCase()]}'+']</dl>', '<div style="display:inline-block;float:right;padding-right:5px;"><input type="button" id="showXML" style="width:50px" value="Edit"/></div>', '</tpl>'
i fail this code,HTML Code:Ext.getCmp('showXML').on('click',function(){//mycode})
and i try another,
and i fail, too.HTML Code:<input type="button" onclick=[{this.myfunction()}] id="showXML" style="width:50px" value="Edit"/>
is there any solution about this?
-
14 Nov 2012 1:13 AM #2
...
...
do you know anything about this?
i use
and also useHTML Code:$('.className').bind({ click:function(){ //mycode }})
but none of these work.HTML Code:listeners:{ afterrender:function(aa, eOpts ){ var id = Ext.id(); var component = Ext.get(id); component.on('click', function(component) { console.log('hhhhh'); }); }
please help me.
-
14 Nov 2012 9:53 AM #3Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,589
- Vote Rating
- 434
- Answers
- 3102
Code:listeners : { element : 'element', delegate : 'input[type=button]', tap : function() {} }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.
-
14 Nov 2012 8:05 PM #4
thanx
thanx
but it didnot work.
so I solve this problem other way
and my templateHTML Code:var valPanel = Ext.create('Ext.view.View',{ store:project_val, id:'gridVal', style:{ background:'#ffffff' }, emptyText:'There is no Data', tpl:tpl, itemSelector:'div.thumb-wrap', listeners:{ itemclick:function(view, e, item, index) { console.log(index); } } } });
HTML Code:'<tpl for=".">', '<div style="padding-top:10px;border-bottom:1px solid #e9e5e5;padding-bottom:10px;">', '<tpl if="this.checkValue(values.type)">', '<dl style="display:inline-block;width:100px;color:red;font-weight:bold;padding-left:20px;">-['+'{[values.type.toUpperCase()]}'+']</dl>', '<div class="thumb-wrap" style="display:inline-block;float:right;padding-right:5px;"><a id="test" class="showXML" href="#"><img src="images/edit.png"></a></div>', '</tpl>', '<tpl if="this.checkValue2(values.type)">', '<dl style="display:inline-block;width:100px;color:blue;font-weight:bold;padding-left:20px;">-['+'{[values.type.toUpperCase()]}'+']</dl>', '<div class="thumb-wrap" style="display:inline-block;float:right;padding-right:5px"><a class="showXML" href="#"><img src="images/edit.png"></a></div>', '</tpl>', '<dt style="display:inline">{title}</dt>', '<dt style="padding-left:30px;">{message}</dt>', '</div>', '</tpl>'
this is work^^


Reply With Quote