【发布时间】:2017-04-01 18:24:05
【问题描述】:
找不到解决方案,所以也许有人会帮忙。
我有一组类似这样的数据:
[
{
id: 1,
name: 'Nissan',
year: 2012,
chassis_color: ['yellow', 'red', 'orange', 'green', 'blue', 'gray', 'black', 'white']
},
{
id: 2,
name: 'Chrysler',
year: 2014,
chassis_color: ['red', 'orange', 'blue', 'gray', 'black', 'white']
},
{
id: 3,
name: 'Volvo',
year: 2015,
chassis_color: ['white', 'orange', 'blue', 'red']
}
]
所以我不知道如何通过手动输入数组值而不是从它的值填充底盘颜色列下拉列表。
文档中的示例:
columns: [
{
type: 'dropdown',
source: ['yellow', 'red', 'orange', 'green', 'blue', 'gray', 'black', 'white']
}
]
但我需要这个:
columns: [
{
type: 'dropdown',
source: 'chassis_color' // it should understand that this property is an array and populate source with it
}
]
以同样的方式工作。
我需要这个,因为我有大量数据,手动设置会很困难。
谢谢。
【问题讨论】: