Solved

Format specific cells or specific rows of a datagrid component.

Posted on 2008-06-25
4
513 Views
Last Modified: 2013-11-11
Seems simple, but I can't figure this out.

Is there any way in AS2 to format a specific cell of a datagrid component? So, let's say I want to make cell 2,4 bold with green text?

If this isn't possibble, or difficult, I could settle with formatting a specific row as such? For example, set row 3 to be bold with green text.
0
Comment
Question by:crickeys
  • 2
  • 2
4 Comments
 
LVL 34

Accepted Solution

by:
Aneesh Chopra earned 125 total points
Comment Utility
Indeed it is possible using CellRenderer Class.

Using CellRenderer class, we can apply complete HTML formatting (supported by flash for any textField) to any cell of DataGrid

here is an example with source files:
http://philflash.inway.fr/htmlrdtip1/htmlrdtip1.zip

you can see the possibilities here
0
 

Author Comment

by:crickeys
Comment Utility
That looks interesting but if I use the following code, the myHtmlFunction never gets fired?
myHtmlFunction = function (itemObj:Object, columnName:String) {
 

	trace("fired");

	

}
 

// --- DataGrid columns ---

userList_lb.columnNames = ["name"];
 

var col:mx.controls.gridclasses.DataGridColumn;

var totalWidth:Number = 0;	
 

col = userList_lb.getColumnAt(0);
 

col.headerText = "Image 1";

col.cellRenderer = "HtmlCellRenderer";

col["htmlFunction"] = myHtmlFunction;

Open in new window

0
 
LVL 34

Assisted Solution

by:Aneesh Chopra
Aneesh Chopra earned 125 total points
Comment Utility
Have you copied "HtmlCellRenderer" into your library or not..?
0
 

Author Comment

by:crickeys
Comment Utility
That was it, thanks.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now