Adobe Dreamweaver Forums



Last 10 THreads :         Code that can effect two movie clips (Last Post : NedWebs - Replies : 1 - Views : 2 )           »          pop up blocker jacking my login (Last Post : reelhero - Replies : 6 - Views : 7 )           »          RoboHelp 7 Skins (Last Post : HelpDev - Replies : 7 - Views : 35 )           »          Clock .getUTC not working (Last Post : kglad - Replies : 3 - Views : 4 )           »          problems linking PDFs (Last Post : Alan - Replies : 1 - Views : 2 )           »          Changing RadioButton Label (Last Post : justintoflex - Replies : 2 - Views : 5 )           »          Table Borders MIssing in JavaHelp (Last Post : soxmann - Replies : 3 - Views : 8 )           »          cfimage error (Last Post : masoud_amen - Replies : 2 - Views : 3 )           »          Dragging components (Last Post : hsfrey - Replies : 2 - Views : 5 )           »          Is file too large? (Last Post : tweaked_eye - 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 12-03-2008, 07:24 AM
niksk
 
Posts: n/a
Diggs:
Default Partial visible data

Hello Everyone

I am working on flex application. In that I have one datagrid. In that
"Location" column I am showing the current folder name as data and tool tip of
that is the complete path of that folder.

But now I want to show the complete URI of that location as data but in this
form ".../location". So that when I stretch out the column the complete path
will show on the column.

So please help me out around this as I am not able to find any topic related
to this.

Thanks



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-04-2008, 05:03 AM
niksk
 
Posts: n/a
Diggs:
Default Re: Partial visible data

Plese give some suggestion.
Reply With Quote
  #3 (permalink)  
Old 12-04-2008, 06:34 AM
atta707
 
Posts: n/a
Diggs:
Default Re: Partial visible data

Essentially, you'll be playing with TextLineMetrics class.

Add a label to disable it's truncateToFit property and start listening for
resize event. The width would in percentage and you'll need to specify minWidth
so that it resizes down as well as up when the container is resized:

<mx:Label id="label1" text="C:\Program Files\Adobe\Flex Builder\Framework\bin"
resize="resizeHandler(event)" truncateToFit="false"
minWidth="50"
width="100%"/>

Now in your resizeHandler method just get a reference of TextLineMetrics by
calling the measureText() method on your label. Run your program in debug mode
(F11) and watch the trace while you resize the window:

private function resizeHandler(event:ResizeEvent) : void {
var tlm:TextLineMetrics = label1.measureText(label1.text);
trace("label width: " + label1.width + ", text width: " + tlm.width)
}


Now use some simple match to decide number of characters that can fit into the
available width of the label.

Turn that Label into a itemRenderer and set it as a renderer for your column
in he grid.

ATTA

Reply With Quote


  #4 (permalink)  
Old 12-04-2008, 01:33 PM
niksk
 
Posts: n/a
Diggs:
Default Re: Partial visible data

Hey Atta

Thanks for your reply.

Actually I have some columns in my datagrid is like....
<mx:columns>
<mx:AdvancedDataGridColumn headerText="" id="chkBox" width="30"
itemRenderer="com.basepin.view.TeamMember.Punchlis tTab.PunchlistTabNavigator.Cen
teredCheckBox" sortable="false" />
<mx:AdvancedDataGridColumn headerText="Actions"
itemRenderer="com.basepin.view.TeamMember.Punchlis tTab.GridRowActionButtonsHBox"
width="200" minWidth="100" sortable="false"/>
<mx:AdvancedDataGridColumn headerText="Closeout Item" id="closeoutItem"
width="370"
itemRenderer="com.basepin.view.TeamMember.Punchlis tTab.PunchlistTabNavigator.Pun
chItemRenderer" editable="false" sortCompareFunction="sByCloseoutItem" />
<mx:AdvancedDataGridColumn headerText="Description" dataField="description"
width="600" editable="true" sortable="false" >

<mx:itemRenderer>com.basepin.view.TeamMember.Punch listTab.PunchlistTabNavigat
or.DescriptionTextArea</mx:itemRenderer>
</mx:AdvancedDataGridColumn>
<mx:AdvancedDataGridColumn headerText="Tasks" id="tasks" width="1200"
itemRenderer="com.basepin.view.TeamMember.Punchlis tTab.PunchlistTabNavigator.Pun
chItemTasksVBox" sortable="false"/>
<mx:AdvancedDataGridColumn headerText="Locations" width="225"
itemRenderer="com.basepin.view.TeamMember.Punchlis tTab.PunchlistTabNavigator.Pun
chItemLocationsVBox" sortable="false"/>
</mx:columns>



and I am using the ItemRenderer for my LOCATION column is like


<?xml version="1.0" encoding="utf-8"?>
<mx:VBox
xmlns:mx="http://www.adobe.com/2006/mxml"
width="100%"
height="100%"
creationPolicy="all"
verticalGap="0"
paddingLeft="5"
paddingRight="5"
paddingTop="3"
paddingBottom="3"
verticalAlign="middle"
>

<mx:Script>
<![CDATA[
import mx.controls.Label;
import mx.core.*;

override public function set data( value:Object ):void
{
super.data = value;
this.removeAllChildren();

if ( super.data == null ) return;

for each ( var closeout_item_location:XML in
data.closeout_item_locations.closeout_item_locatio n )
{
var sTagId:String = closeout_item_location.tag_id;
var sName:String = closeout_item_location.tag_name;
var sURI:String = closeout_item_location.uri;
var lbl:Label = new Label();
lbl.text = sName;
lbl.toolTip = sURI;
lbl.selectable = true;
this.addChild( lbl );
}
}


]]>
</mx:Script>
</mx:VBox>

So here I want to show the label as full URI but in ".../location" form and
when I stretch the column from mouse It should show the
".../location/location", I mean URI from rightside.......



Reply With Quote
  #5 (permalink)  
Old 12-05-2008, 04:15 AM
niksk
 
Posts: n/a
Diggs:
Default Re: Partial visible data

Need Some Help.......
Reply With Quote
  #6 (permalink)  
Old 12-10-2008, 12:43 PM
niksk
 
Posts: n/a
Diggs:
Default Re: Partial visible data

I need help around it, I am not able to find any way around it.
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 12:05 AM.


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