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>
相关推荐
90后的晨仔4 小时前
从 H5 到 uni-app:一篇写给前端小白的"翻译指南"
前端·vue.js·前端框架
陈随易4 小时前
moon,apt和yum之外linux系统命令安装新选择
前端·后端·程序员
IT小盘5 小时前
13-企业Prompt模板-角色任务约束与输出格式
java·前端·prompt
徐小夕5 小时前
开源!我用SQLite + DuckDB打造了一款可视化AI问数平台
前端·算法·github
leslie1186 小时前
babel笔记
前端
用户059540174466 小时前
Redis 记忆存储踩坑实录:一个并发写入 Bug 让我排查了 4 小时
前端·css
小徐_23337 小时前
Wot UI 2.3.0 发布:二维码组件来了,Open Wot 与 wot-starter 同步更新
前端·微信小程序·uni-app
kyriewen7 小时前
Claude自己跑出去hack了3家公司——我为什么还在用它写代码
前端·ai编程·claude
IT_陈寒7 小时前
SpringBoot自动配置的坑,这次真踩疼我了
前端·人工智能·后端
子兮曰8 小时前
AI 浏览器 Agent 的安全困局:当自动化工具可以偷走你的登录态
前端·人工智能·后端