magicsuggest 多选以及带搜索功能的下拉框


界面模块比较多,这里主要贴第一个企业下拉列表的相关代码,有问题可提问


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>&nbsp;&nbsp;' + 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="" />


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值