easyui 二级联动实现

		
<span style="white-space:pre">		</span>$.parser.parse($("#personal"));//append追加html进行样式渲染
<span style="white-space:pre">		var v=row.publicFiguresType;</span>
		$('#public_figures_type').combobox({
                    url:"publicuser/figjson/0",
                    editable:false,
                   // panelWidth:130,
                   // width:130,
                    valueField: 'publicFigureClassify',
                	textField: 'classifyName',
                    onSelect:function(record){//选择触发
                    	var url="publicuser/figjson/"+record.publicFigureClassify;
                    	$('#public_figures_types').combobox({
                    		 url:url,
                             editable:false,
                            // panelWidth:130,
                            // width:130,
                             valueField: 'publicFigureClassify',
                         	textField: 'classifyName',
                         	 onLoadSuccess: function () { //数据加载完毕事件
                                 var data = $('#public_figures_types').combobox('getData');
                                 if (data.length > 0) {
                                	 //(row.publicFiguresType!=null?row.publicFiguresType:data[0].publicFigureClassify)
                                     $("#public_figures_types").combobox('select',v!=null?v:data[0].publicFigureClassify);
                                     v=null;
                                 }
                             }
                    	});
                    },
                    onLoadSuccess: function () { //数据加载完毕事件
                        var data = $('#public_figures_type').combobox('getData');
                       // alert(data);
                        if (data.length > 0) {
                            $("#public_figures_type").combobox('select',dt.ty);
                        }
                    }
				});

你可能感兴趣的:(easyui)