当前位置 博文首页 > wusq的博客:EasyUI下拉框Combobox设置某些选项不可选置灰
data = [{
"id":1,
"text":"text1",
"disabled": true
},{
"id":2,
"text":"text2",
"disabled": false
},{
"id":3,
"text":"text3"
,{
"id":4,
"text":"text4",
"disabled": true
},{
"id":5,
"text":"text5"
}]
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/color.css">
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/demo/demo.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
</head>
<body>
<input id="cc" class="easyui-combobox" name="dept">
<script>
var data = [{
"id":1,
"text":"text1",
"disabled": true
},{
"id":2,
"text":"text2",
"disabled": false
},{
"id":3,
"text":"text3"
},{
"id":4,
"text":"text4",
"disabled": true
},{
"id":5,
"text":"text5"
}]
$('#cc').combobox({
data:data,
valueField:'id',
textField:'text'
});
</script>
</body>
</html>
?
cs