easyui的datagrid列的editor值为combobox时怎么动态加载数据

2024-12-27 10:58:43
推荐回答(1个)
回答1:

直接在option里面写即可

                {
                    title: '企业',
                    field: 'Ent',
                    align: 'center',
                    width: 100,
                    editor: {
                        type: 'combobox',
                        options: {
                            data: GetEnt(),
                            valueField: "value",
                            textField: "text",
                              editable: false,
                            required: true
                        }
                    }
                }

其中GetEnt方法中可以写ajax  返回一个对象数组 如[{ value: 0, text:'企业1' },{ value: 2, text:'企业1' }]