13 Oct 2010 6:31 AM #1
[3.3] ActionColumn behavior/configuration sort of weird
Hi, it's me again,
I was very happy to see the ActionColumn as an official part of ExtJS now, but it seems that it is not as easy as I thought to have it configured and used correctly.
BTW: The documentation for the getClass config is very confusing: You should really indent the parameters for this function correctly because css and attr are not arguments, but properties of the metadata argument!
OK, back to topic.
I wanted to use an ActionColumn as a status indicator, so I chose to use the mentioned getClass config to return an icon class depending on a specific field in each record. But why is the CSS class I return from this function applied to the image inside the column? That does not work for me! So if I want to re-use my CSS icon classes I have to apply the CSS class to the td that contains the div (Ext doesn't give me any other possibility). But this is not exactly brilliant either, because there is only one td per ActionColumn. So why can't I reach the div?
Another problem: The parameter v of the getClass function should be the value of the corresponding field. But when I use the value, it's an empty string. If I use the record parameter instead, the value returned from the record is correct. In this case the field is an integer, but I set the dataIndex config value correctly. So I don't know what I'm doing wrong.
Does anyone experience something like this, too?
It shows the icons now. The work-around for me is to set width and height of the image, too. So I return not only a CSS class that sets the background-image, I return two classes - image class and a class which sets the size to 16*16. I don't know if this is intended behavior - this is not necessary in any other place...
14 Oct 2010 8:00 AM #2
I did think the implementation of the ActionColumn was a little clunky. Using image tags as opposed to going with a span with a background hurts theming and such. I don't think I would classify this as a bug so much as being a suggestion for a later version of ActionColumn.
By krafting in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 1 Feb 2010, 11:27 PM
By zhegwood in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 29 Dec 2009, 10:02 AM
By fawzyj in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 20 Oct 2007, 1:54 PM
By bdp in forum Ext 1.x: Help & DiscussionReplies: 0Last Post: 15 Sep 2007, 7:17 PM
By bidyut in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 15 Dec 2006, 5:35 PM