ExtJs6 checkboxgroup组件根据数据库数据默认选中设置方法

来源:互联网 发布:淘宝直通车在哪里找图 编辑:程序博客网 时间:2024/04/30 02:53

一般checkboxgroup这个组建用在formpanel里,所以在formpanel渲染之前加入以下方法:

form部分:items : [    {        xtype: 'checkboxgroup',        bind : {            fieldLabel : '{meal}'        },        items: [            {                bind : {                    boxLabel: '{breakfast}'                },                name: 'breakfast',                inputValue : 1            },{                bind : {                    boxLabel: '{lunch}'                },                name: 'lunch',                inputValue : 2            },{                bind : {                    boxLabel: '{dinner}'                },                name: 'dinner',                inputValue : 4            },{                bind : {                    boxLabel: '{snack}'                },                name: 'snack',                inputValue : 8            }        ]    }]controller部分:var formpanel = this.getView();formpanel.getForm().findField('breakfast').setValue(true);
0 0
原创粉丝点击