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>
相关推荐
来自星星的坤11 分钟前
【Vue 3 + Vue Router 4】如何正确重置路由实例(resetRouter)——避免“VueRouter is not defined”错误
前端·javascript·vue.js
香蕉可乐荷包蛋4 小时前
浅入ES5、ES6(ES2015)、ES2023(ES14)版本对比,及使用建议---ES6就够用(个人觉得)
前端·javascript·es6
未来之窗软件服务5 小时前
资源管理器必要性———仙盟创梦IDE
前端·javascript·ide·仙盟创梦ide
liuyang___6 小时前
第一次经历项目上线
前端·typescript
西哥写代码6 小时前
基于cornerstone3D的dicom影像浏览器 第十八章 自定义序列自动播放条
前端·javascript·vue
清风细雨_林木木6 小时前
Vue 中生成源码映射文件,配置 map
前端·javascript·vue.js
FungLeo7 小时前
node 后端和浏览器前端,有关 RSA 非对称加密的完整实践, 前后端匹配的代码演示
前端·非对称加密·rsa 加密·node 后端
雪芽蓝域zzs7 小时前
JavaScript splice() 方法
开发语言·javascript·ecmascript
不灭锦鲤7 小时前
xss-labs靶场第11-14关基础详解
前端·xss
不是吧这都有重名7 小时前
利用systemd启动部署在服务器上的web应用
运维·服务器·前端