我有 jsondata 如下:
"rows":[
{"code":"001","name":"Name 1","addr":"Address 11","col4":{"data":"col4 data","value":"col4 value"}},
{"code":"002","name":"Name 2","addr":"Address 13","col4":{"data":"col4 data","value":"col4 value"}},
{"code":"003","name":"Name 3","addr":"Address 87","col4":{"data":"col4 data","value":"col4 value"}},
{"code":"004","name":"Name 4","addr":"Address 63","col4":{"data":"col4 data","value":"col4 value"}},
{"code":"005","name":"Name 5","addr":"Address 45","col4":{"data":"col4 data","value":"col4 value"}},
{"code":"006","name":"Name 6","addr":"Address 16","col4":{"data":"col4 data","value":"col4 value"}},
{"code":"007","name":"Name 7","addr":"Address 27","col4":{"data":"col4 data","value":"col4 value"}},
{"code":"008","name":"Name 8","addr":"Address 81","col4":{"data":"col4 data","value":"col4 value"}},
{"code":"009","name":"Name 9","addr":"Address 69","col4":{"data":"col4 data","value":"col4 value"}},
{"code":"010","name":"Name 10","addr":"Address 78","col4":{"data":"col4 data","value":"col4 value"}}
]
旨在在两个不同的列中显示 col4 的数据和值。因此,在 treegrid 表定义中添加了以下内容。
{field:'col4',title:'Col41 data',width:150,rowspan:2,formatter:function (value,row,index){return value["data"];}},
{field:'col4',title:'Col41 value',width:150,rowspan:2,formatter:function (value,row,index){return value["value"];}}
预计它可以工作,但格式化程序只能看到数据字段。第二个格式化程序永远不会适用于该列。
有谁知道任何可用的解决方法?