package com.sandman.view
{
import mx.controls.DataGrid;
public class MessagesDataGrid extends DataGrid
{
public function MessagesDataGrid() {
super();
}
public function getRowAt(rowIndex:int):MessagesDataGridRow {
var row:* = super.listItems[rowIndex];
return new MessagesDataGridRow(row);
}
}
}
MessagesDataGridRow:
package com.sandman.view
{
public class MessagesDataGridRow
{
private var row:*;
public function MessagesDataGridRow(itemRow:*) {
row = itemRow;
}
public function setStyle(attribute:String, value:String):void {
var length:int = row.length;
var i:int;
for (i=0; i<length; i++) {
row[i].setStyle(attribute, value);
}
}
}
}
Example usage:
var row:MessagesDataGridRow = yourGrid.getRowAt(3);
row.setStyle('fontWeight', 'bold');
row.setStyle('fontStyle', 'italic');
You'll likely want to modify this to suit your needs.
No comments:
Post a Comment