-
14 Mar 2012 6:04 AM #1
Unanswered: how add dynamic button in grid panel column using renderer?
Unanswered: how add dynamic button in grid panel column using renderer?
hi,
i am using extjs 4.0.2a.
i find this example on net http://www.rahulsingla.com/sites/def...-GridPanel.htm
i try this one in extjs 4.0.2a but not work.
show this error in firebug
function () {var btn = new (Ext.Button)({renderTo: id, text: "Price: " + value});}.defer is not a function
[Break On This Error] }).defer(25);
i need button grid panel column and click that button show window(passing parameter to render grid inside window).
is it possible to do this?
-
14 Mar 2012 7:43 AM #2
Demo here http://ext4all.com/post/how-add-dyna...using-rendererCode:renderer: function (v, m, r) { var id = Ext.id(); Ext.defer(function () { Ext.widget('button', { renderTo: id, text: 'Edit: ' + r.get('name'), width: 75, handler: function () { Ext.Msg.alert('Info', r.get('name')) } }); }, 50); return Ext.String.format('<div id="{0}"></div>', id); }
-
14 Mar 2012 8:07 PM #3
Thanks
Thanks
Hi khmurach,
Thanks for your Reply. Its helpful to me.
-
7 Apr 2012 3:55 AM #4Sencha - Ext JS Dev Team
- Join Date
- Mar 2007
- Location
- Notts/Redwood City
- Posts
- 30,458
- Vote Rating
- 20
- Answers
- 9
Bad idea. It will leave orphaned Button instances all over the place.
Use an ActionColumnSearch the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
25 Jun 2012 2:37 AM #5
Animal, please supply an example for the ActionCommand that handles exactly as the code above. It seems that it's a often used feature, but a simple example is never to be found.
-
25 Jun 2012 2:38 AM #6Sencha - Ext JS Dev Team
- Join Date
- Mar 2007
- Location
- Notts/Redwood City
- Posts
- 30,458
- Vote Rating
- 20
- Answers
- 9
The very first grid example, the simplest one has an ActionColumn in it.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
25 Jun 2012 3:09 AM #7
Thanks, the example handled adding a actioncomand in two different ways, which was a bit confusing, but I figured it out now.
-
29 Nov 2012 4:30 AM #8
Hi Animal,
I understand the problems behind
And in my case it won't (or at least not in an as straight forwards way as above).Code:renderer: function (v, m, r) { var id = Ext.id(); Ext.defer(function () { Ext.widget('button', { renderTo: id, text: 'Edit: ' + r.get('name'), width: 75, handler: function () { Ext.Msg.alert('Info', r.get('name')) } }); }, 50); return Ext.String.format('<div id="{0}"></div>', id); }
However I do need to find a way to put a button with icon and text in to the column and it doesn't seem possible with the standard Ext action column.
What are your suggestions ?


Reply With Quote