0

我正在尝试在 UiApp 中查看一些电子表格数据,但遇到了一个简单的问题,超出了我的工资等级。

我已经使用列表框打开了电子表格并拉出了标题,现在想在另一个列表框中显示电子表格标题。当我知道如何从数组中填充列表框时,它不起作用,所有标题都显示为一个项目。

以下是日志中的标题:

*[[Item Name, Item Sku/Model#, Main, Seler Logo, UPC, M.S.R.P., MAP Price, Website Customer Price, Amazon Competitive Situation, Ship Weight, FedEx Ground HD 06413 to 90210, Amazon Selling Price, Shipping Charge, Selling Price + Shipping Charge, Amazon Commission @ 15%, Product Cost, Shipping Cost FedEx Ground HD (FR. Col L), Profit, Margin %, Actual Weight, Length, Width, Height, Description/Copy, Technical Specs, Order Fullfilled by:, Shipment Within:, Stock Level, ]]*

我使用以下代码将它们添加到列表框中:

var listbox = app.createListBox();
for(i in data){
listbox.addItem(data[i]);  
  }

我猜这是额外的一组括号,但我之前不需要从数据字符串中删除任何内容。一点帮助?

谢谢,马丁

4

1 回答 1

3

这确实是一个二维数组,这里只有列是感兴趣的,因为你只取了一行,改变如下:

var listbox = app.createListBox();
for(i in data[0]){
listbox.addItem(data[0][i]);  
  }
于 2013-01-24T21:49:17.197 回答