easy ui给元素增加属性
我用easy ui做的后台系统,当我想用以下的语句给select元素增加disabled属性时,发现属性加上去了,但不生效:
这是在js中的代码:
$('#planInnerGerberPeopleEdit').attr('disabled',true);
$('#PlanToolRectverNo_fledit').form('load', {
idPlanToolRectverNo_flEdit : obj.rows[0].id,
PlanToolRectverNo_timeflEdit : rows[0].dateTimex,
PlanToolRectverNo_jobsflEdit : obj.rows[0].jobName,
planRegisterflEdit : obj.rows[0].register,
planChangeReasonflEdit : obj.rows[0].changeReason,
planProcessflEdit : obj.rows[0].inventoryProcess,
planInnerGerberEdit : obj.rows[0].innerGerber,
planOutGerberEdit : obj.rows[0].outGerber,
planTsGerberEdit : obj.rows[0].tsGerber,
planToGerberEdit : obj.rows[0].toGerber,
planOtherGerberEdit : obj.rows[0].otherGerber,
planInnerGerberPeopleEdit : obj.rows[0].rectverInner,
planInnerGerberTimeEdit : obj.rows[0].innerTime,
planOutGerberPeopleEdit : obj.rows[0].rectverOut,
planOutGerberTimeEdit : obj.rows[0].outTime,
planTsGerberPeopleEdit : obj.rows[0].rectverTs,
planTsGerberTimeEdit : obj.rows[0].tsTime,
planToGerberPeopleEdit : obj.rows[0].rectverTo,
planToGerberTimeEdit : obj.rows[0].toTime,
planOtherGerberPeopleEdit : obj.rows[0].rectverOther,
planOtherGerberTimeEdit : obj.rows[0].otherTime,
planRectverFlEdit : obj.rows[0].rectverFl,
planflTime : obj.rows[0].flTime
}).dialog('open');
这里html中dialog的代码:
  <label>内层回收人: </label>
<c:if test="${DepartmentPe == 'FL'}">
<select id="planInnerGerberPeopleEdit" name="planInnerGerberPeopleEdit"
class="easyui-combobox" panelHeight="auto" style="width: 105px">
<option value=${makeName}>${makeName}</option>
这是在js中的代码:
$('#planInnerGerberPeopleEdit').attr('disabled',true);
$('#PlanToolRectverNo_fledit').form('load', {
idPlanToolRectverNo_flEdit : obj.rows[0].id,
PlanToolRectverNo_timeflEdit : rows[0].dateTimex,
PlanToolRectverNo_jobsflEdit : obj.rows[0].jobName,
planRegisterflEdit : obj.rows[0].register,
planChangeReasonflEdit : obj.rows[0].changeReason,
planProcessflEdit : obj.rows[0].inventoryProcess,
planInnerGerberEdit : obj.rows[0].innerGerber,
planOutGerberEdit : obj.rows[0].outGerber,
planTsGerberEdit : obj.rows[0].tsGerber,
planToGerberEdit : obj.rows[0].toGerber,
planOtherGerberEdit : obj.rows[0].otherGerber,
planInnerGerberPeopleEdit : obj.rows[0].rectverInner,
planInnerGerberTimeEdit : obj.rows[0].innerTime,
planOutGerberPeopleEdit : obj.rows[0].rectverOut,
planOutGerberTimeEdit : obj.rows[0].outTime,
planTsGerberPeopleEdit : obj.rows[0].rectverTs,
planTsGerberTimeEdit : obj.rows[0].tsTime,
planToGerberPeopleEdit : obj.rows[0].rectverTo,
planToGerberTimeEdit : obj.rows[0].toTime,
planOtherGerberPeopleEdit : obj.rows[0].rectverOther,
planOtherGerberTimeEdit : obj.rows[0].otherTime,
planRectverFlEdit : obj.rows[0].rectverFl,
planflTime : obj.rows[0].flTime
}).dialog('open');
这里html中dialog的代码:
  <label>内层回收人: </label>
<c:if test="${DepartmentPe == 'FL'}">
<select id="planInnerGerberPeopleEdit" name="planInnerGerberPeopleEdit"
class="easyui-combobox" panelHeight="auto" style="width: 105px">
<option value=${makeName}>${makeName}</option>
运行效果如下:
属性加上去了,但根本不生效,还是可编辑状态,不知如何解决.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
谢谢,果然有用
$('#selected-id').
combobox({readonly: true})