AdvancedDataGrid Flex - 行未添加到正确的列下
我正在动态添加行,但它们似乎没有位于正确的列下。我的所有标题都在“headerArray”中,我需要添加的数据位于字符串“item”中。
//create an item to work with
var chartItem:Object = new Object();
for( var j:int = 0; j < columnResult.length ; j++ )
{
var item:String = removeformat(removetd(columnResult[j]));
//grab the header (this is which column the value will be added
var head:String = headerArray[j];
//set the value to header (pair)
chartItem[head] = item;
}
//add the chartItem (row) to the main collection
arr.addItem(chartItem);
tableCollection = arr;
它正确获取所有标题并设置图表项(通过调试器检查)。当它到达一行(从 html 构建)时,其中有一个项目仅具有某些列的值,它不会在右列下添加信息,它只是从左到右并将其添加到下一张。
这种行为有点奇怪,因为 ChartItem 显然具有正确的标题值和相应的项目值,但就像我说的那样,它们最终没有出现在正确的列下。
tableCollection 稍后被设置为网格的数据提供者(此后未修改)
I'm dynamically adding rows and they don't seem to go under the proper column. I have all of my headers in 'headerArray' and the data i need to add is in the string 'item'.
//create an item to work with
var chartItem:Object = new Object();
for( var j:int = 0; j < columnResult.length ; j++ )
{
var item:String = removeformat(removetd(columnResult[j]));
//grab the header (this is which column the value will be added
var head:String = headerArray[j];
//set the value to header (pair)
chartItem[head] = item;
}
//add the chartItem (row) to the main collection
arr.addItem(chartItem);
tableCollection = arr;
It's getting all the headers properly and setting the chartItem (from inspection with debugger). When it gets to a row (building from html) where there is an item that only has values for some of the columns, it doesn't add the information under the right column, it just goes from left to right and adds it in the next one.
The behaviour is kind of strange because the chartItem clearly has the right header value and corresponding item value in it, but like I said they don't end up under the right column.
tableCollection gets set as the dataprovider for the grid later (not modified since)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我读取该行的跨度属性,我将下一行设置为列+上一个跨度。然后所有行都正确排列。
If i read the span attribute for the row, i set the NEXT row to be at column+previous colspan. then all the rows line up properly.