1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    50
    Vote Rating
    0
    url is on a distinguished road

      0  

    Default Unanswered: How to fire an click event for an xtemplate

    Unanswered: How to fire an click event for an xtemplate


    Hi All,

    There is tpl tag for a container where the html is getting prepared. I want to fire an click event for the template .How can i achieve this?


    Code Snippet:


    {
    xtype:'container',
    cls:'post-body-cont',
    // id : me.getId()+'-header',
    data:{'message':me.msg,'lastmoddate':me.lastmodifi ed,splitbuttonhtml:me.splitButtonHtml },
    tpl:new Ext.XTemplate(' <div id = '+me.getId()+'-header onClick = '+this.something()+'><span style="margin- left:20px;"> {message}</span>' +
    '<div style="float:right;" >{splitbuttonhtml}</div>'+
    '<img border="0" data-qtip=" collapse" data-qclass="seek-qtip"'+
    ' src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" '+
    'class="x-wtc-link-btn expanding" style="float:right;">' +
    '<img border="0" data-qtip="REPLY" data-qclass="seek-qtip" '+'src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" '+
    ' class="x-wtc-link-btn reply" style="float:right;" >'+
    '<label class="x-component x-component-default" style="float:right;margin-right:8px;border-width:0;"> {lastmoddate}</label> </div>'
    ,{ compiled:true,
    getcontextMenu:function(){
    return '<span>getContextMenu</span>';
    }

    })




    }


    Any help is highly appreciated.

  2. #2
    Touch Premium Member suzuki1100nz's Avatar
    Join Date
    Apr 2011
    Location
    New Zealand
    Posts
    345
    Vote Rating
    17
    Answers
    15
    suzuki1100nz will become famous soon enough suzuki1100nz will become famous soon enough

      0  

    Default


    declare an onRender function and in it access the XTemplate div by a dom query attach a click listener to the found element.

Tags for this Thread