View Full Version : Is it possible to insert button into template?

29 Jun 2009, 12:34 PM
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


4 Jul 2009, 9:15 AM
you can apply generic HTML buttons and use a selector to apply an instance of Ext.Button to each of the html buttons.

19 Jul 2009, 12:36 AM
Do you have some example? I would like to do something similar.

Thank you,

19 Jul 2009, 12:47 AM
Do you have some example? I would like to do something similar.

Thank you,


Just use the applyTo or renderTo configs of Button:


19 Jul 2009, 1:27 AM
I am using grid with expandable row and this row has template:

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,