-
25 May 2012 2:32 AM #1
How to add a click event in controller for Action Column Item using Architect?
How to add a click event in controller for Action Column Item using Architect?
Hi guys,
I have an action column item and I want create a click event in my controller. I know there is a handler event in the action column itself. But I really need to reference in my controller file. I can't find any id/itemid property for action column item. So how how can a refer this element in the controller.
Please help me. here is my code
Code:.........some other grid items .......... { xtype: 'actioncolumn', id: 'acViewCashDetails', width: 50, align: 'center', items: [{ getClass: function(v, metadata, r, rowIndex, colIndex, store) { if(r.get('referral_count')>0){ this.items[0].tooltip='Click to view the details.'; return 'view'; }else{ return ''; } }, handler: function(view, rowIndex, colIndex, item, e) { //some codes here. then it will work but, i already have a function in controller // and I really want to use that function or just want create another in controller } } ] } ........some other grid items .......
-
25 May 2012 2:18 PM #2
You can use xtypes in your control query similar to this
http://docs.sencha.com/ext-js/4-0/#!...ComponentQueryBharat Nagwani
Sencha Designer Development Team
-
26 May 2012 7:33 PM #3
I couldn't find a click event for an actioncolumn as well, so i just fired a custom event from the handler, then listened from the controller
-
2 Jun 2012 1:26 PM #4
UI: Sencha Architect 2.x / ExtJS 4 MVC
Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
Application Server: Glassfish 3.1.x
Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5
If you like my answer please vote!
-
3 Jun 2012 10:54 PM #5
-
4 Jun 2012 12:19 PM #6
UI: Sencha Architect 2.x / ExtJS 4 MVC
Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
Application Server: Glassfish 3.1.x
Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5
If you like my answer please vote!
-
5 Jun 2012 3:58 AM #7
Hi,
Do you have any idea to invoke a function from the "handler"? Of course the function should be defined in the "Controller" !
Thanks,
Jineesh
-
5 Jun 2012 6:45 AM #8
I though you already figured out.
1. Define the custom event in the gridpanel:
ext1.png
2. Fire the event in the handler. Note that you must fire the event from the grid to capture in the controller. I tried to capture the gridview event (query: "grid gridview") but didn't worked.
ext2.jpg
3. Add the controller action:
ext3.jpg
I wish we could be able to extend column as another components but you cant drop column in views node.
Hope this helps.
Regards.UI: Sencha Architect 2.x / ExtJS 4 MVC
Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
Application Server: Glassfish 3.1.x
Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5
If you like my answer please vote!
-
6 Jun 2012 4:45 AM #9
Thanks to share this point. Let me have try.
Regards,
Jini
-
23 Jan 2013 2:35 PM #10
Action Column with controller
Action Column with controller
Worked for me, and thanks for the example. i was not getting the handler part, and then i found this
In the Grid Panel i create a Custom Event with a parameter record;
At then Action Column handler:
handler: function(view, rowIndex, colIndex, item, e, record, row) {
view.up('grid panels widget').fireEvent('My grid Custom Event',record);
},
at the Controller i created the listener and worked just fine.
Regards


Reply With Quote