-
29 Jun 2009 12:34 PM #1
Is it possible to insert button into template?
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
-
4 Jul 2009 9:15 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
you can apply generic HTML buttons and use a selector to apply an instance of Ext.Button to each of the html buttons.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
19 Jul 2009 12:36 AM #3
include button in template
include button in template
Do you have some example? I would like to do something similar.
Thank you,
Simon
-
19 Jul 2009 12:47 AM #4
Simon,
Just use the applyTo or renderTo configs of Button:
http://extjs.com/deploy/dev/docs/?class=Ext.Button
-
19 Jul 2009 1:27 AM #5
replace html template element with ext component
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
Now I would like to replace this 3 html components with ext button, ext.combobox and ext.fileupload control.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>' ) });
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


Reply With Quote