Srinivas B
Srinivas B

Reputation: 1852

How to add and remove the cls in the action column of the grid dynamically

I want to add and remove the cls of the action column in the grid dynamically.

Can any one help me in doing this?

Upvotes: 1

Views: 742

Answers (1)

Reimius
Reimius

Reputation: 5712

The easiest way to do this is to not use an actioncolumn actually. Use a normal column and render the image you want and then have a hander for the column click, here is code actually used in my application for a single column:

   {
                width: 25,
                renderer: function(value, metaData, record){
                    if(record.get("node_type") == "CONDITION")
                        return "<img src=\"magnifier.png\"/>";
                    return "";
                },
                listeners: {
                    click: function(grid, htmlRow, index, columnIndex, mouseEvent, record){
                                         //do something here
                    }
                }
            }

Upvotes: 1

Related Questions