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>
相关推荐
堕落年代7 分钟前
Vue主流的状态保存框架对比
前端·javascript·vue.js
没资格抱怨8 分钟前
el-pagination的使用说明
javascript·vue.js·elementui
OpenTiny社区18 分钟前
TinyVue的DatePicker 组件支持日期面板单独使用啦!
前端·vue.js
冴羽18 分钟前
Svelte 最新中文文档教程(22)—— Svelte 5 迁移指南
前端·javascript·svelte
树上有只程序猿22 分钟前
Vue3组件通信:多个实战场景,轻松玩转复杂数据流!
前端·vue.js
青红光硫化黑27 分钟前
React基础之useEffect
javascript·react.js·ecmascript
剪刀石头布啊30 分钟前
css属性值计算过程
前端·css
bin915334 分钟前
DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)之添加列宽调整功能,示例Table14基础固定表头示例
前端·javascript·vue.js·ecmascript·deepseek
小华同学ai37 分钟前
吊打中文合成!这款开源语音神器效果炸裂,逼真到离谱!
前端·后端·github
二川bro42 分钟前
TensorFlow.js 全面解析:在浏览器中构建机器学习应用
javascript·机器学习·tensorflow