Re: [flexcoders] subclassing DataGrid
Because all property names are in the same namespace as the component. components:MyBetterDataGrid components:columns mx:DataGridColumn On 6/21/10 1:47 PM, mitchgrrt mitch_g...@hotmail.com wrote: I have: components:MyBetterDataGrid mx:columns mx:DataGridColumn and am getting the error message: Could not resolve mx:columns to a component implementation MyBetterDataGrid extends DataGrid. Why isn't the compiler letting me declare the columns? Is there a way to do this? Thanks. -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] subclassing DataGrid
I have: components:MyBetterDataGrid mx:columns mx:DataGridColumn and am getting the error message: Could not resolve mx:columns to a component implementation MyBetterDataGrid extends DataGrid. Why isn't the compiler letting me declare the columns? Is there a way to do this? Thanks.
RE: [flexcoders] Subclassing DataGrid Observations
Thanks for the feedback Tim. Ive forwarded these on so we can have the suggestions added into the bugbase. From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Tim Hoff Sent: Saturday, October 21, 2006 8:27 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Subclassing DataGrid Observations Hi all, In the process of creating this sample, I learned a couple of things about the DataGrid control that might be useful to others and Adobe. The followinghighlighted items are thenew CSS properties that I used: headerColors:#99, white, white; headerColorsRatios:0, 60, 255; headerColorsAlphas:.6, .4, 1; headerSeparatorSkin:ClassReference(skins.DataGridHeaderSeparator); rollOverColor:white; rollOverColorAlpha:.3; selectionColor:white; selectionColorAlpha:.4; caretColor:#DD; caretColorAlpha:1; Observations: 1. The headerColors drawn are actually three colors instead of two. The first and second colors drawnare hardcoded to use the first headerColor in the array. The third color drawn uses the second headerColor in the array. Changed the CSS to allow three different colors. 2. When making the headers transparent, the headerSeparator doesn't line-up correctly. Used a headerSeparatorSkin. 3.A caret is the outline border around the selected item. 4. By default, the caret is drawn only when the user selects anitem with keyboard navigation. However, once activated, the caret is drawn when an item is selected with the mouse as well. I liked the look of the caret, so I activated it when the item is selected (either way). Also, added the ability to change the caret color and alpha. Some might also like to see the caret when an item is highlighted, but I didn't want to mess with the drawItem() function. 4. The drawItem() function in the ListBase class is used to draw a sprite for the selected or highlighted cell. However, this function is overriden in the DataGridBase class to repeat for each cell on the row. 5. The applySelectionEffect() function has hardcoded tween alpha values from 0 to 1. 6. The ListBase class uses a couple of private functions to handle the tween effect. These must be copied, as well as any necessary imports, into thesubclass. Wish List: (I know, not the right place for this, but related none the less) 1. CSS properties listed above. 2. Conditional row and item colors. (see RowColorDataGrid) 3. Persistent sort orders. The sort is reset when the dataProvider is refreshed with new data. It would be nice to have a CSS Boolean property to swithch this behavior on or off. I'm mentioning these observations, not to criticize, but rather to offer suggestions that might be incorporated into a future release. My thought is, if you offer a backgroundAlpha property for a composite control or composite container (Panel), thedeveloper should also have control over alpha values for the other parts of the control. Yes, you can apply an alpha value for the entire control, but this might not always be suitable or as easy to read. Just observations and constructive suggestions. -TH ___ Tim Hoff Cynergy Systems, Inc http://www.CynergySystems.com Office: 1.866.CYNERGY __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company Your email settings: Individual Email|Traditional Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___
[flexcoders] Subclassing DataGrid Observations
Hi all, In the process of creating this sample, I learned a couple of things about the DataGrid control that might be useful to others and Adobe. The followinghighlighted items are thenew CSS properties that I used: headerColors:#99, white, white;headerColorsRatios:0, 60, 255;headerColorsAlphas:.6, .4, 1;headerSeparatorSkin:ClassReference("skins.DataGridHeaderSeparator");rollOverColor:white;rollOverColorAlpha:.3;selectionColor:white;selectionColorAlpha:.4;caretColor:#DD;caretColorAlpha:1; Observations: 1. The headerColors drawn are actually three colors instead of two. The first and second colors drawnare hardcoded to use the first headerColor in the array. The third color drawn uses the second headerColor in the array. Changed the CSS to allow three different colors. 2. When making the headers transparent, the headerSeparator doesn't line-up correctly. Used a headerSeparatorSkin. 3.A "caret" is the outline border around the selected item. 4. By default, the caret is drawn only when the user selects anitem with keyboard navigation. However, once activated, the caret is drawn when an item is selected with the mouse as well. I liked the look of the caret, so I activated it when the item is selected (either way). Also, added the ability to change the caret color and alpha. Some might also like to see the caret when an item is highlighted, but I didn't want to mess with the drawItem() function. 4. The drawItem() function in the ListBase class is used to draw a sprite for the selected or highlighted cell. However, this function is overriden in the DataGridBase class to repeat for each cell on the row. 5. The applySelectionEffect() function has hardcoded tween alpha values from 0 to 1. 6. The ListBase class uses a couple of private functions to handle the tween effect. These must be copied, as well as any necessary imports, into thesubclass. Wish List: (I know, not the right place for this, but related none the less) 1. CSS properties listed above.2. Conditional row and item colors. (see RowColorDataGrid)3. Persistent sort orders. The sort is reset when the dataProvider is refreshed with new data. It would be nice to have a CSS Boolean property to swithch this behavior on or off. I'm mentioning these observations, not to criticize, but rather to offer suggestions that might be incorporated into a future release. My thought is, if you offer a backgroundAlpha property for a composite control or composite container (Panel), thedeveloper should also have control over alpha values for the other parts of the control. Yes, you can apply an alpha value for the entire control, but this might not always be suitable or as easy to read. Just observations and constructive suggestions. -TH___ Tim HoffCynergy Systems, Inchttp://www.CynergySystems.comOffice: 1.866.CYNERGY __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company Your email settings: Individual Email|Traditional Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___
Re: [flexcoders] subclassing DataGrid in Beta 3
On 5/12/06, Jim Laing [EMAIL PROTECTED] wrote: So, one of our requirements is to make the up/down arrow keys work in a DataGrid that is being edited. In Beta 2, I was able to subclass certain functions (keyDownHandler, findNextEnterItemRenderer) of the DataGrid which were marked public at the time. Now it seems these functions are marked private so I am unable to subclass them. Does anyone have any ideas as to how I can achieve functionality similar to the code below? I don't know why it's private now, but maybe you could try looking at the findNextItemRenderer() implementation in the DataGrid.as in the B3 source and try implementing something along those lines? -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[flexcoders] subclassing DataGrid in Beta 3
So, one of our requirements is to make the up/down arrow keys work in a DataGrid that is being edited. In Beta 2, I was able to subclass certain functions (keyDownHandler, findNextEnterItemRenderer) of the DataGrid which were marked public at the time. Now it seems these functions are marked private so I am unable to subclass them. Does anyone have any ideas as to how I can achieve functionality similar to the code below? Thanks, Jim -- package com.wgint.wglib { import mx.controls.DataGrid; import flash.ui.Keyboard; import flash.events.KeyboardEvent; public class WGDataGrid extends DataGrid { public function WGDataGrid() { super(); } override public function keyDownHandler(event:KeyboardEvent):void { if(event.keyCode == Keyboard.DOWN) { event.shiftKey = false; findNextEnterItemRenderer(event); } if(event.keyCode == Keyboard.UP) { event.shiftKey = true; findNextEnterItemRenderer(event); } super.keyDownHandler(event); } } } -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.