Adobe Flex

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Remember me

Go Back   Tutorialized ForumsWeb Design & DevelopmentAdobe Flex

Add This Thread To:   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
Unread Tutorialized Forums Sponsor:
Old February 26th, 2015, 04:59 AM
rmccleave559 rmccleave559 is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
Join Date: Feb 2015
Posts: 1 rmccleave559 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 12 sec
Reputation Power: 0
Apply DataGridColumn label function to only one label

I have a datagrid column object that is written completely in actionscript, I assign to it a label function that changes the format for a date the problem is that it sets all of the labels in the panel, I want to just set one.

Is there a way to control which labels have the function is applied to?

private function buildTargetDataDG(xmlStageDataList:XMLListCollecti on, bgColor:Boolean):void

//returns a normal array of objects that specify DataGridColumn properties
var aColumnDef:Array=getColumnDefArray();
var oColumnDef:Object;

//instantiate a new DataGrid
var dgataGrid=new DataGrid;
var dgcataGridColumn;
var aColumnsNew:Array=dg.columns
var iTotalDGWidth:int=0;

//loop over the column definition array
for (var i:int=0; i < aColumnDef.length; i++)
//instantiate a new DataGridColumn
dgc=new DataGridColumn();
dgc.labelFunction. = convertDateData;
//start setting the properties from the column def array
//add up the column widths
// datagrid columns text alignment
dgc.setStyle("textAlign", oColumnDef.textAlign);

if(dgc.dataField == "PLOT")
dgc.rendererIsEditor= oColumnDef.rendererIsEditor;// true;
dgc.itemRenderer=new ClassFactory(CBRenderer);

//push the new dataGridColumn onto the array

dg.editable = true;

//dg.addEventListener(ListEvent.ITEM_CLICK, dgRowItemClickEvent);
dg.addEventListener(MouseEvent.CLICK, setSelectedData);
//set the dataProvider
if((xmlStageDataList != null)&&(xmlStageDataList.length > 0))
dg.enabled= false;

// resizing the datagrid size to accomodate 3 rows + header..
dg.height = 92; //
dg.width = iTotalDGWidth;


private function convertDateData(item:Object, columnataGridColumn):String
var xml:XML = item as XML;

if(xml == null)
var temp:String = xml.child("PDATETIME").text();
var day: int = parseInt(temp.substr(0,20));
var month: int = parseInt(temp.substr(3,2))-1;
var year:int = parseInt(temp.substr(6,4));
var hour:int = parseInt(temp.substr(11,2));
var min:int = parseInt(temp.substr(14,2));
var sec:int = parseInt(temp.substr(17,2));
var tempDateate = new Date(year, month, day, hour, min, sec);

var formatterateFormatter = new DateFormatter();
formatter.formatString = "DD-MMM-YY HH:NN:SS";
temp = formatter.format(tempDate);
return temp;
return null;


Reply With Quote

Viewing: Tutorialized ForumsWeb Design & DevelopmentAdobe Flex > Apply DataGridColumn label function to only one label

Developer Shed Advertisers and Affiliates

Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:

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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.

© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap