界面模块比较多,这里主要贴第一个企业下拉列表的相关代码,有问题可提问
1.css引用js引用
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../js/jquery.easyui.min.js"></script>
<link rel="stylesheet" href="../../css/magicsuggest-1.2.2.css" /><script type="text/javascript" src="../../js/magicsuggest-1.2.2.js"></script>
2.主要js:
var <span style="font-family: Arial, Helvetica, sans-serif;">proorgdata;</span>
function initproorgdata() { //初始化企业json数据var arrays = new Array();$.each(treedata, function(index, item) {var demo = {id: item.POGuid,name: item.ProOrgName,desc: ""};arrays.push(demo)});proorgdata = arrays;}
function initqiye() { //初始化企业下拉<span style="white-space:pre"></span>qiyebox = $('#qiyebox').magicSuggest({ //抄送 <span style="white-space:pre"></span>data: proorgdata, //数据源 <span style="white-space:pre"></span>cls: 'sfl-msg',<span style="white-space:pre"></span>allowFreeEntries: false, //不允许输入不匹配的<span style="white-space:pre"></span>maxSelection: 1000, //最多可以选择几个 <span style="white-space:pre"></span>queryParam: 'qiyebox',<span style="white-space:pre"></span>placeholder: '请选择', //提示<span style="white-space:pre"></span>renderer: function(v) {<span style="white-space:pre"></span>return '<div>' +<span style="white-space:pre"></span>'<b>' + v.name + '</b>' +<span style="white-space:pre"></span>'<span> ' + v.desc + '</span>' +<span style="white-space:pre"></span>'</div>' +<span style="white-space:pre"></span>'<div style="clear:both;"></div>';<span style="white-space:pre"></span>},<span style="white-space:pre"></span>objOfEi: $("#qiyeids"), //id<span style="white-space:pre"></span>objOFDisplay: $("#qiyenames") //name<span style="white-space:pre"></span>});<span style="white-space:pre"></span>qiyebox.selectionchange = checktree;<span style="white-space:pre"></span>}3.html:
<input id="qiyebox" name="qiyebox" type="text" /><input id="qiyeids" type="hidden" value="" /><input id="qiyenames" type="hidden" value="" />