Adobe Dreamweaver Forums



Last 10 THreads :         Strip EXIF camera data from PSD files? (Last Post : Russell_Proulx@adobeforums.com - Replies : 2 - Views : 3 )           »          CSH Calls for Merged CHM's (Last Post : TrentSnake - Replies : 0 - Views : 1 )           »          Image Replacement (Last Post : WhatNow - Replies : 0 - Views : 1 )           »          Embedding Flash SWF Skin in External Site (Last Post : QADesign - Replies : 0 - Views : 1 )           »          Compatible issue with ie6 (Last Post : zhtjlong - Replies : 0 - Views : 1 )           »          Re: Photoshop CS4 is a disaster (Last Post : Paulo_Skylar@adobeforums.com - Replies : 0 - Views : 1 )           »          Query question/help (Last Post : trojnfn - Replies : 2 - Views : 3 )           »          CS4 Motion Editor issues (Last Post : aaronlyon - Replies : 4 - Views : 9 )           »          Bridge No Longer Rotates Automatically (Last Post : Michael_Palumbo@adobeforums.com - Replies : 1 - Views : 2 )           »          dollarFormat / numberformat problem (Last Post : izdabye - Replies : 0 - Views : 1 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-03-2008, 04:38 AM
Karl_Sigiscar_1971
 
Posts: n/a
Diggs:
Default AdvancedDatagrid with a summary row

Hello,

I have an AdvancedDatagrid with two grouping fields in a summary row.

Everything works fine when there is no labelFunction associated with it.
But as soon as I specify a labelFunction, the summary row fields are empty. I
need a labelFunction to format dates and numbers.

How to write a proper labelFunction for an AdvancedDatagrid with a summary row
?

Regards,
Karl.




Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-03-2008, 04:38 AM
Karl_Sigiscar_1971
 
Posts: n/a
Diggs:
Default Re: AdvancedDatagrid with a summary row

Okay, I figured it out.

Now, I have two label functions set at the AdvancedDataGridColumn level for
the summary row fields and one labelFunction set at the AdvancedDataGrid level
for all the other fields.
<mx:AdvancedDataGridColumn
id="amountTotal" dataField="sumAmount" labelFunction="sumAmountLabelFunction"
/>
<mx:AdvancedDataGridColumn
id="collectedTotal" dataField="sumCollected" labelFunction="sumCollectedLabelFun
ction" />

In order to avoid a null pointer exception on the sumAmount and sumCollected
fields in the label function, I use the hasOwnProperty() method to check before
access. Otherwise, this exception will happen while expanding the tree.

private function sumAmountLabelFunction(item:Object,
column:AdvancedDataGridColumn):String
{
if(item.hasOwnProperty("sumAmount"))
return this.numberFormatter.format(item.sumAmount);

return "";
}

private function sumCollectedLabelFunction(item:Object,
column:AdvancedDataGridColumn):String
{
if(item.hasOwnProperty("sumCollected"))
return this.numberFormatter.format(item.sumCollected);

return "";
}


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 04:08 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.
Inactive Reminders By Mished.co.uk