EasyUI EasyUI combogrid 组合框使用

2019/07/20 15:22
阅读数 44

1.开启分页、 两个组合框级联、选中赋值等功能

<select class="easyui-combogrid" id="clientls" style="width:200px" data-options="
                    panelWidth: 500,
                    idField: 'ID',
                    textField: 'ClientCode',
                    url: 'GetSelectClientList',
                    method: 'get',
                    pagination : true,
                    rownumbers:true,
                    collapsible:false,
                    pageSize: 10,
                    pageList: [10],
                    columns: [[
                        {field:'ID',title:'ID',width:80},
                        {field:'Stype',title:'账套',width:80},
                        {field:'ClientCode',title:'客户编号',width:80,align:'right'},
                        {field:'ClientName',title:'客户名称',width:80,align:'left'}
                    ]],
                    fitColumns: true,
                    onSelect : function(rowIndex, rowData) {$('#Stype').textbox('setValue', rowData.Stype);$('#ClientCode').combogrid('grid').datagrid('options').queryParams.filter = $('#clientls').textbox('getText');$('#ClientCode').combogrid('grid').datagrid('reload');},
                    labelPosition: 'top'"></select>



                        <select class="easyui-combogrid" id="ClientCode" style="width:200px" data-options="
                    panelWidth: 800,
                    idField: 'ID',
                    textField: 'SendAddress',
                    url: 'GetSelectClientList' ,
                    method: 'get',
                    pagination : true,
                    rownumbers:true,
                    collapsible:false,
                    pageSize: 10,
                    pageList: [10],
                    columns: [[
                        {field:'ID',title:'ID',width:50},
                        {field:'Stype',title:'账套',width:30},
                        {field:'ClientCode',title:'客户编号',width:80,align:'left'},
                        {field:'SendAddress',title:'送货地址',width:350,align:'left'},
                        {field:'SendName',title:'送货抬头',width:250,align:'left'},
                        {field:'SendNameSub',title:'送货子抬头',width:250,align:'left'},
                        {field:'InvoiceName',title:'发票抬头',width:80,align:'left'}
                       ]],
                    onSelect : function(rowIndex, rowData) {$('#Stype').textbox('setValue', rowData.Stype);$('#clientls').textbox('setValue', rowData.ClientCode);$('#SendName').textbox('setValue', rowData.SendName);$('#SendNameSub').textbox('setValue', rowData.SendNameSub);$('#InvoiceName').textbox('setValue', rowData.InvoiceName);},
                    labelPosition: 'top'"></select>


//设置筛选条件。可用于上下级联动。

$('#ClientCode').combogrid('grid').datagrid('options').queryParams.filter = $('#clientls').textbox('getText');$('#ClientCode').combogrid('grid').datagrid('reload')

 

onSelect事件设置选中后赋值、  级联动。注意调用api 最好返回string 格式json

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部