Hi everybody,
ist there a way to use the combotree with multiple select, without using JSON?
<select id="cc" class="easyui-combotree" style="width:200px;"
data-options="url:'myjosnfile',required:true">
</select>
I would like to use this, with some fixed strucutre of <ul><li> inside the HTML, but i can't manage it getting the data out of the UL LI structure.
Thanks.
Update: It got it running that way:
Even the getChecked is working :-)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jQuery EasyUI</title>
<link rel="stylesheet" type="text/css" href="easyui.css">
<link rel="stylesheet" type="text/css" href="icon.css">
<script type="text/javascript" src="jquery-latest.js"></script>
<script type="text/javascript" src="jquery.easyui.min.js"></script>
<script>
$(document).ready(function() {
$('#cc').combotree('loadData', [{
id: 1,
text: 'Level1',
children: [{
id: 11,
text: 'Level2a',
children: [{
id: 21,
text: 'Level3a'
}, {
id: 22,
text: 'Level3b'
}]
},{
id: 12,
text: 'Level2b'
}]
}]); required: true
});
</script>
</head>
<body>
<span>Select:</span>
<select id="cc" class="easyui-combotree" style="width:150px;" multiple="true" onlyLeafCheck="true"></select>
<a href="javascript:void(0)" onclick="getChecked()">GetChecked</a>
<script>
function getChecked(){
var nodes = $('#cc').combotree('tree');
var mytree = nodes.tree('getChecked');
var s = '';
var s = '';
for(var i=0; i<mytree.length; i++){
if (s != '') s += ',';
s += mytree[i].text;
s += mytree[i].id;
}
alert(s);
}
</script>
</body>
</html>