function Getorgansid () {
Url= "<%=basepath%>/rest/bsc/organ/selectorgansidalllist";
$.ajax ({
Type: "POST",
Url:url,
DataType: "JSON",
ContentType: "Application/json; Charset=utf-8 ",
data:,
Success:function (data) {
if (data.res>0) {
var $domOptions =data.data;
$domOptions. Sort (function (A, b) {return a.sid-b.sid});//Sort
$.each ($domOptions, function (n,value) {
$.each ($domOptions, function (n,value) {
//$ ("#se_organObject"). Append ("<option s Id= "+value.sid+" value= "+n+" > "+value.organname+" </option> ");//Add option
//$ (" #s E_organobject "). Append ($ (" <option></option> "));//Add Option
$ (" #se_organObject "). Append ($ (" <option> "));//Add Option
$ (" #se_organObject option:eq ("+n+)"). attr ("s ID ", VALUE.SID);
$ ("#se_organObject option:eq (" +n+ ")"). attr ("value", value.organname);
$ ("#se_organObject option:eq (" +n+ ")"). Text (value.organname);
}
);
}
);
}else{
LAYER.MSG ("Data acquisition failed!", {offset: "100px"});
}
Sid=[];
Contentitem=[];
Perioddata=[];
perioddata1={};
json={};
}
});
}
var Organsid = $ ("#se_organObject option:selected"). attr ("Sid");
alert (ORGANSID);
if (typeof (organsid) = = = "undefined") {
organsid=10;
}
jquery sort and dynamically add option and properties