Results 1 to 2 of 2

Thread: Regarding tpl button eventhndler

  1. #1
    Sencha User
    Join Date
    Dec 2012
    Location
    India
    Posts
    2
    Vote Rating
    0
      0  

    Default 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:progidXImageTransform.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">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</span>', '<span><input type=button value=Delete>&nbsp&nbsp</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
    ],
    });
    Attached Images Attached Images

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    You have to add element listeners to it...

    Code:
    view.el.on('click', someFunction, view, { delegate : 'button' });
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •