I'm pulling xml data to determine which columns are visible, and the widths of each column. My datagrid's width can change sinces its on one side of a HDividedBox. The visibility part works, but setting the width is causing headaches. Heres the code:
for(loop through column data retrieve from XML)
{
newData[i] = dg.columns[Number(columnsOrder[i]) - 1];
newData[i].visible = (Number(columnsVisibility[i]) == 1);
newData[i].width = Number(columnsWidth[i]);
trace(newData[i].headerText + " w:" + newData[i].width.toString() + " v:" + newData[i].visible.toString());
}
dg.columns = newData;
dg.invalidateList();
In the trace the width is correct for the first two items, however, its showing up as "20" for ever consecutive one...
Date w:240 v:true
Title w:184 v:true
Requestor w:20 v:true
Approved By w:20 v:true
Category w:20 v:false
Status w:20 v:false
Priority w:20 v:false
When I output Number(columnsWidth[i]) it shows up as the correct value so something weird is happening in the assignment of the width.
Been looking at this for a few hours now, and have tried multiple things to try to fix it to no avail.