标签:
引入文件
chosen.css
jquery-1.7.1.min.js
chosen.jquery.js
绑定数据:
for (var i = 0; i < data.length; i++) { $("#ddlExchangeID").append("<option value=\"" + data[i].DictionaryID + "\">" + data[i].DictionaryName + "</option>"); } $("#ddlExchangeID").trigger("liszt:updated"); $("#ddlExchangeID").chosen();
初始化选定数据
$("#ddlExchangeID option[value=‘" + data.Source + "‘]").attr("selected", "selected");
$("#ddlExchangeID").chosen();
标签:
原文地址:http://www.cnblogs.com/kongxp/p/4380314.html