Easyui DataGrid combobox联动下拉框内容

发票信息下拉框联动,更具不同的发票类型,显示不同的税率

专票

普票

下拉框选择事件

javascript 复制代码
function onSelectType(rec){
        //选中值
		if (rec=='2'){
            //普通发票对应税率
			pmsPlanList.pmsInvoiceTaxRate=pmsPlanList.pmsInvoiceTaxRateT
		}else {
            //专用发票对应税率
			pmsPlanList.pmsInvoiceTaxRate=pmsPlanList.pmsInvoiceTaxRateP
		}
		var row =$("#dgPmsPlanList").datagrid('getSelected');
		//获取行号
		var rowIndex = $("#dgPmsPlanList").datagrid('getRowIndex',row);
		var target = $('#dgPmsPlanList').datagrid('getEditor', {'index':rowIndex,'field':'taxRate'}).target;
		//清除原来的数据
		target.combobox('clear');
        //加载新下拉数据
		target.combobox('loadData',pmsPlanList.pmsInvoiceTaxRate);
	}
html 复制代码
<table id="dgPmsPlanList"
		           data-options="
						fit: true,
						border: false,
						rownumbers: true,
						animate: true,
						collapsible: false,
						fitColumns: true,
						autoRowHeight: false,
						toolbar:'#toolbarPmsPlanList',
						idField :'id',
						singleSelect: true,
						checkOnSelect: true,
						selectOnCheck: false,
						pagination:false,
						onDblClickRow:onDbClickRowEvent,
						pageSize:dataOptions.pageSize,
						pageList:dataOptions.pageList,
						showFooter:true,
						striped:true">
		        <thead>
<tr>
<th  data-options="field:'pmsInvoiceType', halign:'center'" width="70" editor="{type:'combobox',options:{required:true,panelHeight:'auto',onSelect: onSelectType}}">
							<span style="color: red;">*</span>发票类型
						</th>
<th  data-options="field:'taxRate', halign:'center'" width="70" editor="{type:'combobox',options:{panelHeight:'auto',editable:false}}">
							<span style="color: red;">*</span>税率
						</th>
</tr>
相关推荐
Hilaku19 小时前
为什么我开始减少逛技术社区,而是去读非技术的书?
前端·javascript·面试
m0_7280331319 小时前
JavaWeb——(web.xml)中的(url-pattern)
xml·前端
猪哥帅过吴彦祖19 小时前
第 8 篇:更广阔的世界 - 加载 3D 模型
前端·javascript·webgl
七月十二19 小时前
[Js]使用highlight.js高亮vue代码
前端
Asort19 小时前
JavaScript设计模式(十二)——代理模式 (Proxy)
前端·javascript·设计模式
简小瑞19 小时前
VSCode源码解密:Event<T> - 类型安全的事件系统
前端·设计模式·visual studio code
寧笙(Lycode)19 小时前
OpenTelemetry 入门
前端
星链引擎19 小时前
智能聊天机器人实践应用版(适合企业 / 项目落地者)
前端
猪哥帅过吴彦祖19 小时前
Flutter 系列教程:列表与网格 - `ListView` 和 `GridView`
前端·flutter·ios
用户3521201956019 小时前
React hooks (useRef)
前端