Microsoft
Software
Hardware
Network
Question : Formatting rows in DataGrid to reflect information in XML file
I have an XML file that is displayed in a Flash DataGrid. The XML file is a collection of Jobs and the information pertaining to them (such as ID, Location, etc.) Each job is displayed on a row of the DataGrid. I want to add some formatting to the rows in the DataGrid based on information contained in the XML file. For example, if I add a subchild
, and it contains the value Bold, I want the text in the whole row in the DataGrid showing that entry to be bold. Likewise, if the subchild
s value is Red, then the background of the whole row showing that record would be colored Red. How do I do this in ActionScript 3.0?
Here is a sample of the XML code:
0023
Senior RFIC Design Engineer
Technologype>
Engineer, General
5 - 10
Los Gatos, CA
BoldFormatting
>
Red
Currently I am using this code to populate the DataGrid, but I can do something completely different if it achieves the goal! It is in ActionScript 3.0:
import fl.controls.DataGrid;
import fl.data.DataProvider;
var dp:DataProvider;
var myDataGrid:DataGrid = new DataGrid();
myDataGrid.addColumn("JobI
D");
myDataGrid.addColumn("JobT
itle");
myDataGrid.addColumn("JobT
ype");
myDataGrid.addColumn("JobS
ubType");
myDataGrid.addColumn("JobY
ears");
myDataGrid.addColumn("JobL
ocation1")
;
myDataGrid.width = 750;
myDataGrid.height = 595;
myDataGrid.move(0, 0);
addChild(myDataGrid);
var url:String = "jobs.xml";
var req:URLRequest = new URLRequest(url);
var uLdr:URLLoader = new URLLoader();
uLdr.addEventListener(Even
t.COMPLETE
, completeHandler);
uLdr.load(req);
function completeHandler(event:Even
t):void {
var ldr:URLLoader = event.currentTarget as URLLoader;
var xmlDP:XML = new XML(ldr.data);
dp = new DataProvider(xmlDP);
myDataGrid.dataProvider = dp;
}
Thanks!
Answer : Formatting rows in DataGrid to reflect information in XML file
Thanks for the examples, they are similar to what I am trying to do. Instead of loading an icon due to data, I want to format a whole row such as with a background color. Thanks for your help, but I am just super new to Flash.
Random Solutions
Outlook Rules not working
What does the Intel ICH9 USB - 2938 driver do. Can it be deleted? - AND - about IRQ rearranging.
Microsoft Outlook encrypted email error message with expired Thawte personal email cert
Can't receive emails that are sent from gmail, hotmail, aol accounts, maybe yahoo as well
Full Outer join in Sybase
Overflow Problem In Access VBA
Sale, Authorization, or Order?
The desktop you are trying to open is currently available only to administrators
Outlook Macro to Attach File
Firefox and sudden shutdown