Unanswered: Action columns and controllers

Unanswered: Action columns and controllers

Has anyone tried to listen to an actioncolumn's handler inside of their controller? I'm trying to stay consistent with the MVC structure but that means in order to use the action column I need to use the handler inside of my view.

In order to work around it I'm using the grid's itemclick event and checking to see if the user is clicking on the icon or not but it seems really hacky.

Has anyone tried to listen to an actioncolumn's handler inside of their controller? I'm trying to stay consistent with the MVC structure but that means in order to use the action column I need to use the handler inside of my view.

In order to work around it I'm using the grid's itemclick event and checking to see if the user is clicking on the icon or not but it seems really hacky.

A click listener on the actioncolumn will fire if you click anywhere in the column.
One option would be to have the handler fire an application level event and have a controller (or controllers) handle it.

Ah, yes, good point. I've always disliked action column, precisely because it makes the regular patterns of the controller approach harder to implement.

One thing I've also done in the past is to simply capture the column click (as in my previous post), and then switch on the target (only meaningful if you have multiple columns...otherwise, no big deal). A little ugly, yes, but it does allow you to not have to slap a handler on the actioncolumn item.

Thanks

Thanks

Thanks guys.

Looks like there isn't really a good solution for this problem. Maybe it will be adjusted in future updates. As of now I'm just going to continue listening to the grid's itemclick event and making sure the user is clicking on the actioncolumn.

But if you target the action column, you will at least know that the click is within the domain of the actioncolumn. Even if you still need to switch on the target, at least you'd only be doing it for legitimate action column clicks, and not for every click on the grid.