1. #1
    Sencha User
    Join Date
    Mar 2008
    Location
    Silver Spring, MD
    Posts
    79
    Vote Rating
    0
    atchijov is on a distinguished road

      0  

    Default Is it possible to insert button into template?

    I have a DataView and I need to be able to add couple buttons to each record. One way of doing it will be to listen to "mousedown" event and then try to figure out which of "buttons" were clicked. I am wondering if there is more "elegant" solution to this problem.

    You comments will be highly appreciated

    Andrei

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    84
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default

    you can apply generic HTML buttons and use a selector to apply an instance of Ext.Button to each of the html buttons.

  3. #3
    Ext JS Premium Member
    Join Date
    Feb 2008
    Posts
    230
    Vote Rating
    2
    simon is infamous around these parts

      0  

    Default include button in template

    Do you have some example? I would like to do something similar.

    Thank you,
    Simon

  4. #4
    Ext JS Premium Member
    Join Date
    May 2007
    Posts
    698
    Vote Rating
    3
    danh2000 is on a distinguished road

      0  

    Default

    Quote Originally Posted by simon View Post
    Do you have some example? I would like to do something similar.

    Thank you,
    Simon
    Simon,

    Just use the applyTo or renderTo configs of Button:

    http://extjs.com/deploy/dev/docs/?class=Ext.Button

  5. #5
    Ext JS Premium Member
    Join Date
    Feb 2008
    Posts
    230
    Vote Rating
    2
    simon is infamous around these parts

      0  

    Default replace html template element with ext component

    I am using grid with expandable row and this row has template:
    http://extjs.com/deploy/dev/examples...d-plugins.html

    Code:
    var expander = new Ext.ux.grid.RowExpander({
    	tpl: new Ext.Template(
    	'<p><input type="button" id="btn{complaintID}">  <b>Company:</b> {company}</p><br>',
    	'<p><b>Summary:</b> {pname} <input type="text" id="combo{complaintID}"</p>'
    	'<p><input type="text" id="fileUpload{complaintID}</p>'
    	)
    });
    Now I would like to replace this 3 html components with ext button, ext.combobox and ext.fileupload control.
    Which event should I use? I tried grid beforerender and store load events, but selector always returns null. Is there some event like row before render?

    Do you have some similar example, how to replace html elements in grid or dataview row template with ext components? I was looking for it but without success.

    Thank you,
    Simon