Easyui中combogrid设置默认值

来源:互联网 发布:人工智能 喜剧 编辑:程序博客网 时间:2024/04/30 02:23

源码如下:

$("#tfvForm").combogrid({        
                    panelWidth: 205,
                    idField: 'id', //ID字段  
                    sortName: 'id',
                    sortOrder: 'asc',
                    textField: 'dictionaryValueName',//显示的字段
                    editable: false,
                    mode: 'remote',
                    required: true,
                    url: tfdURL + '!dataGrid.action',
                    queryParams:{
                        fieldId: row.templateFieldId
                    },
                    columns:[[{
                        field:'id',
                        hidden:true,
                        width:40
                    }]],
                    onSelect:function(index,row){
                        f.find('#tdkForm').val(row.dictionaryKey);
                        f.find('#tdvForm').val(row.dictionaryValueName);
                    },

//设置默认值代码
                    onLoadSuccess:function(){
                        $("#afvForm").combogrid("setValue",row.apiDictName);
                    }
                 });

0 0
原创粉丝点击