PDA

View Full Version : Action column icon change issue



kishorkoli8
10 Mar 2015, 11:27 PM
Hello experts,
I have 2 grid say A and B, I need to change action columns icon of grid A onbutton click grid b,
I am using code like,


var button = Ext.query('td.x-action-col-cell img', myGrid.getView().getNode(index))[4]

I got myGrid and index correctly, but when alert (button.src)
I am always getting the icon source of zeroth(0th) row, I haveto get the source with respective to index I have provided.

Please help.

Gary Schlosberg
6 Apr 2015, 3:40 PM
Sometimes it makes it easier for others to contribute to a solution if you post the partially working code to allow folks to tinker.
https://fiddle.sencha.com/#home

yeghikyan
7 Apr 2015, 6:13 AM
Sorry I do not understand you exactly but...
...but to change the icon of the action column, you can use getClass(http://docs-origin.sencha.com/extjs/4.2.2/#!/api/Ext.grid.column.Action-cfg-getClass) property of the action column.
So, add apropriate field to the second grid's store, which will be responsible for the icon class and in the button handler change apropriate record of the second grid's store.

This code is too indian. :-|

var button = Ext.query('td.x-action-col-cell img', myGrid.getView().getNode(index))[4]

kishorkoli8
8 Apr 2015, 2:15 AM
Sorry I do not understand you exactly but...
...but to change the icon of the action column, you can use getClass(http://docs-origin.sencha.com/extjs/4.2.2/#!/api/Ext.grid.column.Action-cfg-getClass) property of the action column.
So, add apropriate field to the second grid's store, which will be responsible for the icon class and in the button handler change apropriate record of the second grid's store.

This code is too indian. :-|

var button = Ext.query('td.x-action-col-cell img', myGrid.getView().getNode(index))[4]

Thank you to judge my coding style sir, I have implemented the geClss method, but the way I was trying is also present in the docs.