combobox数据绑定

时间:2023-03-10 02:36:28
combobox数据绑定

jquery easyui datagrid 可编辑行 combobox数据绑定问题

将带有参数的url地址赋值给变量,然后将变量赋值给url

<script type="text/javascript">  
var urldep = '../../Ajax/KPIPerformanceGoalsHandler.ashx?mode=getun&depart=' + $('#hidDepart').val();
var urlzhibiao = '../../Ajax/KPIPerformanceGoalsHandler.ashx?mode=getfi2&depart=' + $('#hidDepart').val() + '&form=' + $('#hidFormId').val();
</script>

<%--<th field:'UserRealName' width="100" formatter="name" data-options="width:100,field:'UserRealName',align:'center',styler:cellStyler,editor:{type:'combobox',
options:{valueField:'UserName',textField:'UserRealName'}},data:products,required:true" rowspan="2">
姓名
</th>--%>     因为数据异步的原因,此处data:products无法接收从后台传回的数据

<th field="UserRealName" width="100"
editor="{type:'combobox',options:{valueField:'UserName',textField:'UserRealName',url: urldep}}" data-options="align:'center'" rowspan="2">
姓名
</th>   可将data属性修改为url属性进行赋值,可成功给编辑中的datagrid行的combobox绑上值