标签:else editable form table length query attr 否则 orm
//须引入jquery和以下
<link rel="stylesheet" type="text/css" href="jquery.editable-select.min.css"/>
<script type="text/javascript" src="jquery.editable-select.min.js"></script>
<select class="form-control" name="entity.contractCode" id="contractCode" value="${entity.contractCode}">
<s:iterator value="contractCodeList">
<s:if test="not empty entity.contractCode">
<option value="${entity.contractCode}" selected>${entity.contractCode}</option>
</s:if>
<s:else>
<option value="${value}">${value}</option>
</s:else>
</s:iterator>
</select>
setSelectedOption("#contractCode",contractCode);
$(‘#contractCode‘).editableSelect({
effects: ‘slide‘,
//可选参数default、fade
filter: false,// 不过滤,否则选中后其它选项消失
});
function setSelectedOption(selector, value){
if (value.length !=0) {
$(selector +" > option[value=‘"+value+"‘]").attr("selected",true);
}
}
标签:else editable form table length query attr 否则 orm
原文地址:https://www.cnblogs.com/vixviy/p/8985759.html