LigerUI - 树表格的数据来自Server
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LigerUI - 树表格的数据来自Server相关的知识,希望对你有一定的参考价值。
官方的Demo只提供了树表格的数据来自本地数据的代码,而实际上从Server获取数据的情况更为常见,通过跟踪源码,发现其参数应该如下配置:
columns: [ { "name": ‘fdisplay‘, "display": "菜单项名称", "align": "left", "width": 300, "type": ‘text‘, ‘id‘: ‘menutree‘ }, { "name": ‘fvisible‘, "display": "可视", "align": "center", "width": 70, "type": ‘checkbox‘, ‘editor‘: { ‘type‘: ‘checkbox‘, } }, { "name": ‘fclick‘, "display": "点击", "align": "center", "width": 70, "type": ‘checkbox‘, ‘editor‘: { ‘type‘: ‘checkbox‘, } }, ], tree: { columnId: ‘menutree‘, idField: ‘fmid‘, parentIDField: ‘fpid‘, }, |
其中,重要的参数用红色字体标出。特别需要指出的是idField和parentIDField字段,在LigerUI的树控件中,类似字段的名称为idFieldName和parentIDFieldName,到了这里后面的“Name”给去掉了。
以上是关于LigerUI - 树表格的数据来自Server的主要内容,如果未能解决你的问题,请参考以下文章