FOR循环中的SumoSelect竞争条件

时间:2018-08-26 12:17:17

标签: jquery sumoselect.js

此代码从数据库中获取列表,并预先填充SumoSelect多选框,并预先检查具有数字键的项目。

for(i=0; i<3; i++){
    var slider_listing_id = res.DATA.LISTING_ID[i];
    var val = res.DATA.RECORD_ID[i];
    var text = res.DATA.TITLE[i];
    //alert(isNumeric(slider_listing_id)); //This alerts all three rows
    returnSelect[0].sumo.add(val,text);
    if(isNumeric(slider_listing_id)){
        //alert(slider_listing_id); // this alerts all three rows IF the line below is 
        //commented out, otherwise it only alerts two rows.
        returnSelect[0].sumo.selectItem(i);         
    }
}

问题是似乎正在发生争用情况,并且代码在调用

时似乎跳过了循环
returnSelect[0].sumo.selectItem(i); 

在每个循环内

0 个答案:

没有答案
相关问题