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>
相关推荐
zm43513 分钟前
浅记Monaco-editor 初体验
前端
超凌16 分钟前
vue element-ui 对表格的单元格边框加粗
前端
前端搬运侠18 分钟前
🚀 TypeScript 中的 10 个隐藏技巧,让你的代码更优雅!
前端·typescript
CodeTransfer19 分钟前
css中animation与js的绑定原来还能这样玩。。。
前端·javascript
liming49520 分钟前
运行node18报错
前端
202622 分钟前
14.7 企业级脚手架-制品仓库发布使用
前端·vue.js
coding随想29 分钟前
揭秘HTML5的隐藏开关:监控资源加载状态readyState属性全解析!
前端
coding随想36 分钟前
等待页面加载事件用window.onload还是DOMContentLoaded,一文给你讲清楚
前端
大舔牛37 分钟前
Viewport 与移动端 1px 问题解析
前端·面试