js map list的应用

来源:互联网 发布:阿里域名备案查询 编辑:程序博客网 时间:2024/06/07 13:19
 var urls='batchpick/getStockBySkuBatch.html?batchCode='+newValue;
$.ajax({
        url : urls,
        type : 'post',
        data:'boxNumber='+boxNumber+'&taryNumber='+taryNumber+'&wmstId=0'+'&type=0',
        dataType : 'json',
        async:false,
        success : function(datas) {
        if(datas){
              //加载箱号combobox
        var shelvesInfoDataOfBoxNumber=[];
        //var map = new Map();
//map.wmstBoxNumber= '(空)';
//shelvesInfoDataOfBoxNumber.push(map);
        var tempBoxNumber=new Array();
for(var i=0;i<datas.length;i++){
if(tempBoxNumber.indexOf(datas[i].wmstBoxNumber) <=-1 ){
var map = new Map();
if(datas[i].wmstBoxNumber == '' || datas[i].wmstBoxNumber == null){
map.wmstBoxNumber= '';
continue;
}else{
map.wmstBoxNumber= datas[i].wmstBoxNumber;
}
                       shelvesInfoDataOfBoxNumber.push(map);
tempBoxNumber.push(datas[i].wmstBoxNumber);
}
}

        $(ed.target).combobox('loadData',shelvesInfoDataOfBoxNumber);

}
        }
    }); 
},
required:true
}
 }},