Solved

Format specific cells or specific rows of a datagrid component.

Posted on 2008-06-25
4
520 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
ID: 21868070
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
ID: 21868441
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
ID: 21871583
Have you copied "HtmlCellRenderer" into your library or not..?
0
 

Author Comment

by:crickeys
ID: 21871590
That was it, thanks.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article, I’ll explain how I make a clipping mask out of several separate vector objects by using the Compound Path option in Adobe Illustrator. A compound path in Illustrator allows grouping of separate objects into one set of vector paths t…
: Microsoft Office Collaborate for free and online versions of Microsoft  Word, Excel, Powerpoint, OneNote, Onedrive , Email, Calendar etc. In short we can say that Microsoft office is a suite of servers, applications and services developed by  Micr…
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 what frame rate is, how to control it and what effect it has on the video.

860 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