给select 赋值,除了已有的value及text,新建一属性simple_name
function GetDicOfficeList(dicType, sid) {
$.ajax({
url: "/Dict/getDictList",
dataType: "json",
data: {
"dictType": dicType
},
success: function (data) {
for (var i = 0; i < data.length; i++) {
$("#" + sid).append($("<option value=\"" + data[i][0] + "\" simple_name=\"" + data[i][2] + "\">" + data[i][1] + "</option>"));
}
}
});
};
取simple_name的值 :
$("#sDocType").change(function () {
var s = $("#sDocType option[value='" + $("#sDocType").val() + "']").attr("simple_name");
});