码迷,mamicode.com
首页 > 其他好文 > 详细

easyui datagrid中关联combox

时间:2015-02-09 10:52:38      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:

datagrid中列上关联combobox
{ field: ‘SysCode‘, title: ‘系统代码‘, width: 150, align: ‘left‘, editor: {
type: ‘combobox‘,
options:
{
valueField: ‘id‘,
textField: ‘要显示的字段名‘,
url: ‘/Sys/SearchCodeInFunctionModel‘,
}
}


<th data-options="field:‘fShipCom‘,width:100,align:‘center‘,
                                    formatter:function(value,row){
                                        return row.fShipCom;
                                    },
                                    editor:{
                                        type:‘combobox‘,
                                        options:{
                                            valueField:‘fShipCom‘,
                                            textField:‘fShipCom‘,
                                            url:‘ShipPlan.ashx?act=getShipCom‘,
                                             onChange :function(value){
                                              
                                                var tr = $(this).closest(‘tr.datagrid-row‘);
                                                 var idx = parseInt(tr.attr(‘datagrid-row-index‘));
                                                 var ed = $(‘#dg‘).datagrid(‘getEditor‘,{index:0, field:‘fShipName‘});
                                                alert(idx);
                                                alert(value);
 
                                                $(ed.target).combobox(‘reload‘,‘ShipPlan.ashx?act=getShipName&fshipCom=‘+escape(value));
                                               
                                                 
                                                },
                                            required:true
                                        }
                                    }">船公司</th>

easyui datagrid中关联combox

标签:

原文地址:http://www.cnblogs.com/lijinchang/p/4280912.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!