Datagrid: Individual Cell Formating
I've been using the DataGrid to emulate a spreadsheet application and since november 2003 I have been hitting a brick wall with the limited formating options offered with the DataGrid component. Cell formating is limited to a Row, Column, Header or entire Grid. How can I format just one Cell.
I asked Macromedia Support and was told that it was in the documentation. I am sensing that this is a standard response when they don't have a clue as I have gone over the documentation many times since Nov and have found nothing. I tried to upload a swf file example to the Macromedia forum and true to form they do not support Swf files to be uploaded to their forum ( I geuss that would be "wishlist.com", right Macromedia?).
So far I have been able to fudge a result by accessing the Textfields used for the DataGrid directly however as soon as the DataGrid is redrawn in anyway any changes made are lost to a Global Formating Function.
//Format selected cells
for(i = this.firstIndex[0]; i < this.secondIndex[0] + 1; i++){
for(j = this.firstIndex[1]; j < this.secondIndex[1] + 1; j++{
//////////////////////////////////////////
//////////Get reference to cell//////////
//////////////////////////////////////////
myCurrentCellRow = "fCell" + i ;
myCurrentListRow = "listRow" + (26 + j);
currentCell = myDataGrid.content_mc[myCurrentListRow];[myCurrentCellRow]; //Access textField directly
//Format text
currentCell.setTextFormat(myTextFormatObj);
//////////////////////////////////////////
}
}
}
|