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‘,

},

 

其中,重要的参数用红色字体标出。特别需要指出的是idFieldparentIDField字段,在LigerUI的树控件中,类似字段的名称为idFieldNameparentIDFieldName,到了这里后面的“Name”给去掉了。

以上是关于LigerUI - 树表格的数据来自Server的主要内容,如果未能解决你的问题,请参考以下文章

ligerui加载数据(服务器)

ligerUI的ligerGrid表格

LigerUI 表单和表格中的combobox如何初始化值

ligerui combox 静态怎么设置选中

LigerUI之Grid使用详解——显示数据 --分页

LigerUI - 提交表单,checkbox没数据