Adobe Dreamweaver Forums



Last 10 THreads :         Conditional loop (Last Post : Dan Bracuk - Replies : 4 - Views : 5 )           »          How to turn IMAGE into MOVIECLIP??? (Last Post : Snufferson - Replies : 0 - Views : 1 )           »          Please point me to the correct topic section of thisForum (Last Post : GillyWilly - Replies : 8 - Views : 9 )           »          DIV in Table not working. (Last Post : adambaum - Replies : 0 - Views : 1 )           »          pop up blocker jacking my login (Last Post : reelhero - Replies : 2 - Views : 3 )           »          SWF slide show does not play (Last Post : Mad Dog - Replies : 3 - Views : 4 )           »          Flash-PHP Mail Form (Last Post : richmaxw - Replies : 0 - Views : 1 )           »          Flex compiler in FlexBuilder and Flex SDK (Last Post : 2009 Matt - Replies : 0 - Views : 1 )           »          Basing new project on old project (Last Post : Stephen Windham - Replies : 2 - Views : 3 )           »          Performing a search within multiple .as files (Last Post : JohnnyDang - Replies : 0 - Views : 1 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags: , , ,



Reply
  #1 (permalink)  
Old 08-25-2008, 10:49 PM
synga
 
Posts: n/a
Diggs:
Default AdvancedDataGrid Vertical Column Headers

Hello All,
Does anyone have any experience with rendering a vertical label as a column
header for an AdvancedDataGrid? I've extended the
AdvancedDataGridHeaderRenderer. I've also embedded the font to allow the label
to be rotated 270 degrees. I've also reposition the label to fit the header
because the rotation axis is in the upper left corner of the label.

I've been sucessful in creating a renderer for the regular DataGrid, but the
AdvancedDataGrid seems to be a totally different beast.

Any tips or code examples would be much appreciated.:confused;



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-29-2008, 03:56 PM
adobenewsbot
 
Posts: n/a
Diggs:
Default Re: AdvancedDataGrid Vertical Column Headers

Adobe Newsbot hopes that the following resources helps you. NewsBot is experimental and any feedback (reply to this post) on its utility will be appreciated:

Flex 3 - About behaviors:
Examples of effects are fading, resizing, or moving a component. .... Note: To use the Fade effect with text, you must use an embedded font,
Link: http://livedocs.adobe.com/flex/3/html/behaviors_02.html

Styling a Flex Button control using embedded fonts at Flex Examples:
The following example shows how you can customize the appearance of a Flex Button control by using an embedded font and removing the Buttons default skin.
Link: http://blog.flexexamples.com/2007/08...mbedded-fonts/

Flex 3 - Working with item renderers:
Example: Using an item renderer with a DataGrid control ... This item renderer uses a Label control to insert the text 'Sale Price!
Link: http://livedocs.adobe.com/flex/3/htm...enderer_8.html

Using embedded fonts with the Panel container in Flex at Flex Examples:
The following example shows how you can use an embedded font with the Flex ... Displaying the sort arrow in a Flex DataGrid control without having to click
Link: http://blog.flexexamples.com/2008/02...ainer-in-flex/

mx.controls.DataGrid (Flex 3):
Examples using item editors with the list-based controls ...... Creates a new object using a context based on the embedded font being used.
Link: http://livedocs.adobe.com/flex/3/lan.../DataGrid.html

Disclaimer: This response is generated automatically by the Adobe NewsBot based on Adobe [L=Community Engine]http://community.adobe.com/ion/search.html[/L].
Reply With Quote
  #3 (permalink)  
Old 10-13-2008, 10:20 PM
dalejoel
 
Posts: n/a
Diggs:
Default Re: AdvancedDataGrid Vertical Column Headers

Did you ever figure it out? I need to do the same thing: print vertical text as the header for an AdvancedDataGridColumn.

Thanks.
Reply With Quote


  #4 (permalink)  
Old 10-14-2008, 02:51 PM
synga
 
Posts: n/a
Diggs:
Default Re: AdvancedDataGrid Vertical Column Headers

dalejoel,
I sort of got it working. I'm not totally happy with the look of it but the
header is vertical. I think my stylesheets are conflicting.

I first created a new container by extending the Canvas and adding a Label
into it. I rotated the label 270 degrees and repositioned it so that the label
is visible. Other settings such as scrolling needed to be turned off.

Then, I extended AdvancedDataGridHeaderRenderer. I had to remove the label in
the renderer and replaced it with a VBox container. Next I placed the
component I created above into the VBox.

In the AdvancedDataGrid, set the headerRenderer to your new renderer.

That's the general idea behind what I implemented. See attached code.
(sample code is modified from working source and have not been tested.) Good
luck. Let me know if you see areas for improvements. I was spending too much
time on this and my other work was piling up.

VERTICAL LABEL: ==========================================

<mx:Style>
@font-face {
src: local("Verdana");
fontFamily: VerdanaEmbedded;
}

@font-face {
src: local("Verdana");
fontFamily: VerdanaEmbedded;
fontWeight: bold;
}
</mx:Style>

<mx:Script>
<![CDATA[
import mx.core.UITextField;
import mx.managers.SystemManager;

[Bindable] public var txtField:UITextField = new UITextField();
[Bindable] public var text:String;


private function initLabel():void {
txtLbl.text = txtField.text;

txtLbl.x = + width / 2 - 8;
txtLbl.y = + parent.parent.height;

txtLbl.rotation = 270;

txtLbl.toolTip = txtField.text;

}
]]>
</mx:Script>

<mx:Label id="txtLbl" fontFamily="VerdanaEmbedded" fontWeight="bold"
rotation="270" width="100%" height="100%"
paddingBottom="0" paddingTop="0" paddingLeft="0" paddingRight="0"/>


HEADER RENDERER: ====================================

/**
* Container of the header text.
*/
private var vBox:VBox ;

public function VADGHeaderRenderer()
{
super();

vBox = new VBox() ;
vBox.styleName = this.styleName ;
vBox.setStyle("horizontalAlign","center") ;


}

/**
* Overridden to make vertical.
* Also, label component is removed from the Header and added to vBox.
* So that, Styles of the Header does not get affected.
*/
override protected function createChildren():void {
super.createChildren();
removeChild(label as DisplayObject) ;

addChild(vBox) ;
vBox.percentHeight = 100;
vBox.percentWidth = 100;
vBox.horizontalScrollPolicy = "off";
vBox.verticalScrollPolicy = "off";

var vLabel:VerticalLabel = new VerticalLabel;

(vLabel as Canvas).styleName = vBox.styleName;

vLabel.txtField = label as UITextField;
vBox.addChild(vLabel as DisplayObject);

}

/**
* used to align the contents
*/
private function sizeRenderer():void {
vBox.setActualSize( getExplicitOrMeasuredWidth()- 20
,vBox.getExplicitOrMeasuredHeight()) ;

//switched height and width
measuredHeight = measuredMinHeight =
vBox.getExplicitOrMeasuredWidth() ;
measuredWidth = measuredMinWidth =
vBox.getExplicitOrMeasuredHeight() - 20 ;
}


override protected function measure():void {
super.measure() ;
sizeRenderer() ;
}

override protected function
updateDisplayList(unscaledWidth:Number,unscaledHei ght:Number):void {
super.updateDisplayList(unscaledWidth,unscaledHeig ht) ;

sizeRenderer();
}

Reply With Quote
  #5 (permalink)  
Old 10-31-2008, 06:24 PM
dalejoel
 
Posts: n/a
Diggs:
Default Re: AdvancedDataGrid Vertical Column Headers

Did you ever figure it out? I need to do the same thing: print vertical text as the header for an AdvancedDataGridColumn.

Thanks.
Reply With Quote
  #6 (permalink)  
Old 10-31-2008, 06:26 PM
dalejoel
 
Posts: n/a
Diggs:
Default Re: AdvancedDataGrid Vertical Column Headers

Did you ever figure it out? I need to do the same thing: print vertical text as the header for an AdvancedDataGridColumn.

Thanks.
Reply With Quote


  #7 (permalink)  
Old 10-31-2008, 06:26 PM
synga
 
Posts: n/a
Diggs:
Default Re: AdvancedDataGrid Vertical Column Headers

dalejoel,
I sort of got it working. I'm not totally happy with the look of it but the
header is vertical. I think my stylesheets are conflicting.

I first created a new container by extending the Canvas and adding a Label
into it. I rotated the label 270 degrees and repositioned it so that the label
is visible. Other settings such as scrolling needed to be turned off.

Then, I extended AdvancedDataGridHeaderRenderer. I had to remove the label in
the renderer and replaced it with a VBox container. Next I placed the
component I created above into the VBox.

In the AdvancedDataGrid, set the headerRenderer to your new renderer.

That's the general idea behind what I implemented. See attached code.
(sample code is modified from working source and have not been tested.) Good
luck. Let me know if you see areas for improvements. I was spending too much
time on this and my other work was piling up.

VERTICAL LABEL: ==========================================

<mx:Style>
@font-face {
src: local("Verdana");
fontFamily: VerdanaEmbedded;
}

@font-face {
src: local("Verdana");
fontFamily: VerdanaEmbedded;
fontWeight: bold;
}
</mx:Style>

<mx:Script>
<![CDATA[
import mx.core.UITextField;
import mx.managers.SystemManager;

[Bindable] public var txtField:UITextField = new UITextField();
[Bindable] public var text:String;


private function initLabel():void {
txtLbl.text = txtField.text;

txtLbl.x = + width / 2 - 8;
txtLbl.y = + parent.parent.height;

txtLbl.rotation = 270;

txtLbl.toolTip = txtField.text;

}
]]>
</mx:Script>

<mx:Label id="txtLbl" fontFamily="VerdanaEmbedded" fontWeight="bold"
rotation="270" width="100%" height="100%"
paddingBottom="0" paddingTop="0" paddingLeft="0" paddingRight="0"/>


HEADER RENDERER: ====================================

/**
* Container of the header text.
*/
private var vBox:VBox ;

public function VADGHeaderRenderer()
{
super();

vBox = new VBox() ;
vBox.styleName = this.styleName ;
vBox.setStyle("horizontalAlign","center") ;


}

/**
* Overridden to make vertical.
* Also, label component is removed from the Header and added to vBox.
* So that, Styles of the Header does not get affected.
*/
override protected function createChildren():void {
super.createChildren();
removeChild(label as DisplayObject) ;

addChild(vBox) ;
vBox.percentHeight = 100;
vBox.percentWidth = 100;
vBox.horizontalScrollPolicy = "off";
vBox.verticalScrollPolicy = "off";

var vLabel:VerticalLabel = new VerticalLabel;

(vLabel as Canvas).styleName = vBox.styleName;

vLabel.txtField = label as UITextField;
vBox.addChild(vLabel as DisplayObject);

}

/**
* used to align the contents
*/
private function sizeRenderer():void {
vBox.setActualSize( getExplicitOrMeasuredWidth()- 20
,vBox.getExplicitOrMeasuredHeight()) ;

//switched height and width
measuredHeight = measuredMinHeight =
vBox.getExplicitOrMeasuredWidth() ;
measuredWidth = measuredMinWidth =
vBox.getExplicitOrMeasuredHeight() - 20 ;
}


override protected function measure():void {
super.measure() ;
sizeRenderer() ;
}

override protected function
updateDisplayList(unscaledWidth:Number,unscaledHei ght:Number):void {
super.updateDisplayList(unscaledWidth,unscaledHeig ht) ;

sizeRenderer();
}

Reply With Quote
  #8 (permalink)  
Old 11-02-2008, 01:32 AM
dalejoel
 
Posts: n/a
Diggs:
Default Re: AdvancedDataGrid Vertical Column Headers

Did you ever figure it out? I need to do the same thing: print vertical text as the header for an AdvancedDataGridColumn.

Thanks.
Reply With Quote
  #9 (permalink)  
Old 11-02-2008, 01:32 AM
synga
 
Posts: n/a
Diggs:
Default Re: AdvancedDataGrid Vertical Column Headers

dalejoel,
I sort of got it working. I'm not totally happy with the look of it but the
header is vertical. I think my stylesheets are conflicting.

I first created a new container by extending the Canvas and adding a Label
into it. I rotated the label 270 degrees and repositioned it so that the label
is visible. Other settings such as scrolling needed to be turned off.

Then, I extended AdvancedDataGridHeaderRenderer. I had to remove the label in
the renderer and replaced it with a VBox container. Next I placed the
component I created above into the VBox.

In the AdvancedDataGrid, set the headerRenderer to your new renderer.

That's the general idea behind what I implemented. See attached code.
(sample code is modified from working source and have not been tested.) Good
luck. Let me know if you see areas for improvements. I was spending too much
time on this and my other work was piling up.

VERTICAL LABEL: ==========================================

<mx:Style>
@font-face {
src: local("Verdana");
fontFamily: VerdanaEmbedded;
}

@font-face {
src: local("Verdana");
fontFamily: VerdanaEmbedded;
fontWeight: bold;
}
</mx:Style>

<mx:Script>
<![CDATA[
import mx.core.UITextField;
import mx.managers.SystemManager;

[Bindable] public var txtField:UITextField = new UITextField();
[Bindable] public var text:String;


private function initLabel():void {
txtLbl.text = txtField.text;

txtLbl.x = + width / 2 - 8;
txtLbl.y = + parent.parent.height;

txtLbl.rotation = 270;

txtLbl.toolTip = txtField.text;

}
]]>
</mx:Script>

<mx:Label id="txtLbl" fontFamily="VerdanaEmbedded" fontWeight="bold"
rotation="270" width="100%" height="100%"
paddingBottom="0" paddingTop="0" paddingLeft="0" paddingRight="0"/>


HEADER RENDERER: ====================================

/**
* Container of the header text.
*/
private var vBox:VBox ;

public function VADGHeaderRenderer()
{
super();

vBox = new VBox() ;
vBox.styleName = this.styleName ;
vBox.setStyle("horizontalAlign","center") ;


}

/**
* Overridden to make vertical.
* Also, label component is removed from the Header and added to vBox.
* So that, Styles of the Header does not get affected.
*/
override protected function createChildren():void {
super.createChildren();
removeChild(label as DisplayObject) ;

addChild(vBox) ;
vBox.percentHeight = 100;
vBox.percentWidth = 100;
vBox.horizontalScrollPolicy = "off";
vBox.verticalScrollPolicy = "off";

var vLabel:VerticalLabel = new VerticalLabel;

(vLabel as Canvas).styleName = vBox.styleName;

vLabel.txtField = label as UITextField;
vBox.addChild(vLabel as DisplayObject);

}

/**
* used to align the contents
*/
private function sizeRenderer():void {
vBox.setActualSize( getExplicitOrMeasuredWidth()- 20
,vBox.getExplicitOrMeasuredHeight()) ;

//switched height and width
measuredHeight = measuredMinHeight =
vBox.getExplicitOrMeasuredWidth() ;
measuredWidth = measuredMinWidth =
vBox.getExplicitOrMeasuredHeight() - 20 ;
}


override protected function measure():void {
super.measure() ;
sizeRenderer() ;
}

override protected function
updateDisplayList(unscaledWidth:Number,unscaledHei ght:Number):void {
super.updateDisplayList(unscaledWidth,unscaledHeig ht) ;

sizeRenderer();
}

Reply With Quote


  #10 (permalink)  
Old 11-03-2008, 04:30 AM
dalejoel
 
Posts: n/a
Diggs:
Default Re: AdvancedDataGrid Vertical Column Headers

Did you ever figure it out? I need to do the same thing: print vertical text as the header for an AdvancedDataGridColumn.

Thanks.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 07:33 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk