-
15 Sep 2010 12:46 AM #1
[FNR] ColorPalette surprise
[FNR] ColorPalette surprise
I have a place in my app, where the user can select different colors. I used a ColorMenu for that, which encapsulates a ColorPalette. I used to set the customer preferred colors like this: menu.getColorPalette().setColors();
I was setting 30 colors and this used to work with gxt 2.1.2.
Now, with the new gxt 2.2, it looks like it is not working anymore. Looking at the ColorPalette code, I was surprised to see that the new ColorPalette is hard-coded to use exactly 40 colors displayed in a 5 (rows) * 8 (columns) matrix. See the code below...
So I think I have 2 options:Code:Grid grid = new Grid(5, 8); grid.getElement().setAttribute("role", "presentation"); grid.setCellPadding(0); grid.setCellSpacing(0); int mark = 0; for (int i = 0; i < 5; i++) { for (int j = 0; j < 8; j++) { String c = colors[mark]; grid.setHTML(i, j, "<a aria-label=" + c + " id=" + XDOM.getUniqueId() + " role=gridcell row=" + i + " col=" + j + " class=\"color-" + c + "\"><em role=presentation><span role=presentation style=\"background:#" + c + "\" unselectable=\"on\"> </span></em></a>"); mark++; } }
1. Set exactly 40 colors.
2. Use the ColorPalette default colors.
Any other solutions to make the old code still work?
-
15 Sep 2010 1:00 AM #2
I will fix the code so also more or less nodes will work without an exception.
You found a bug! We've classified it as
a bug in our system.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
Similar Threads
-
ColorPalette questions
By ddanny in forum Ext GWT: DiscussionReplies: 4Last Post: 6 Jul 2010, 9:54 AM -
[FNR-25] ColorPalette with custom color options - Null pointer exception
By troyg in forum Ext GWT: Bugs (2.x)Replies: 3Last Post: 2 Mar 2010, 11:21 AM -
ColorPalette in Grid
By TAG in forum Ext 3.x: Help & DiscussionReplies: 10Last Post: 15 Sep 2009, 5:57 AM -
Value of colorpalette
By Carb0 in forum Ext 2.x: Help & DiscussionReplies: 6Last Post: 2 Apr 2009, 1:07 AM -
IE6/7 (Surprise) toolbar issue
By sam_mooball in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 12 Dec 2007, 4:28 PM


Reply With Quote