Hi, another post today.
This time i will speak about datagrid component. How many of us, didn’t want to customize our datagrid or our list component aon a Flash movie? Is it difficult?
For those who think yes, pls check following links and source files.
Hope now people can improve their skills using these technique’s.
Example 1

Download Source files example 1
Example 2

Code of this example
var gc2 = new DataGridColumn("country");
gc2.width = 100;
gc2.headerText = "Country:";
gc2.cellRenderer = "IconCellRenderer";
gc2.iconFunction = contactIconFunction;
Declare contactIconFunction as follows:
contactIconFunction = function (itemObj:Object, columnName:String) {
if (itemObj == undefined || columnName == undefined) {
return;
}
switch (columnName) {
case "country":
var country = itemObj.country;
return (country == undefined ? undefined : "flag_"+country);
break;
}
}
Download source file example 2
Example 3

Download source file example 3
Hope you enjoy.
Tags: actionscript 2, Adobe, api, AS2, cellrenderer, datagrid, examples, Flash
| Copy and Paste the code below | |
| Email and IM | |
| Websites | |
| Forums | |
follow:
February 27th, 2007 at 5:38 am
hi!!
i have some doubts..
i can make a link for each data in a datagrid?
February 27th, 2007 at 2:42 pm
Hello Daniel,
Didn’t understand what do you mean with link for each datagrid.
Is it to use links inside datagrid as data? if so check this post http://flashenabled.wordpress.com/2007/02/02/datagrid-cellrenderer-more-examples/
If you have any other question, leave your post here.
Brgds,
CP
March 29th, 2007 at 12:09 pm
hello…
will u plz help me…
i want to make a link of each data in a datagrid column
means text which is display in a datagrid column..
April 12th, 2007 at 11:07 pm
i will try. on the text you must use html. Check the html cell renderer at http://flashenabled.wordpress.com/2007/02/05/datagrid-htmlcellrenderer/
hope it can help. let me know.
brgds,
cp
May 8th, 2007 at 6:29 pm
Thanks for the examples.
Is it possible to show a small video window in a datagrid?
May 9th, 2007 at 4:10 pm
Dear Aaron,
Hi. Never tried but i think so. I beleive you must import FLV component inside the datagrid in order you can use it like on the example 3.
Brgds,
CP
February 26th, 2008 at 9:37 am
Can I have a example in CS3, and how can I have a dragable row from DataGrid.
February 26th, 2008 at 6:19 pm
I think you might want to try the flex or air. Because it was the only program i know it is possible to do it. On Flash never tried.
November 19th, 2008 at 1:01 pm
Hi,
Ive been looking for something to explain how to use cellrenderer, mainly so that I can simply have text wrap around in the cells.
The only examples Ive found so far have allowed the text to display outside the boundaries of its cell, although it certainly wraps OK. I dont claim to understand why.
I ran up this example to see if it dies what I need, so that I could then try and understand how it works.
But Im using Actionscript 3. It complains that the definition of baseclass UIComponent was not found on line 11 of MultilineCell.as.
Is there a simple fix ?
You probably guessed, Im new to Flash and AS3, but Im learning quickly . . .