Jquery ui 将选项动态附加到select中不起作用
DDL没有使用新的选项集刷新 $(“#selectid”).live('change',function(){ 如果($('option:selected',$(this)).text()='--Next 50--'){Jquery ui 将选项动态附加到select中不起作用,jquery-ui,Jquery Ui,DDL没有使用新的选项集刷新 $(“#selectid”).live('change',function(){ 如果($('option:selected',$(this)).text()='--Next 50--'){ var current50th=(parseInt($(this.val())-1); var Upper五十=parseInt(当前五十+50); var系数=“”; 对于(var i=当前50;i
var current50th=(parseInt($(this.val())-1);
var Upper五十=parseInt(当前五十+50);
var系数=“”;
对于(var i=当前50;i<上限50;i++){
if(集合[i].ID!=null&&collection[i].ID!=“未定义”){
copions=copions+“”+集合[i]。Text+“”;
}
}
警报($(this.html());
$(此)。附加(选项);
$(this.append($(“”).val((大写50+1)).html(“--Next 50--”);
var allhtml=($(this.html());
$(this.trigger('refresh');
}
});
var currentFifty = (parseInt($(this).val()) - 1);
var upperFifty = parseInt(currentFifty + 50);
var cOptions = '';
for (var i = currentFifty; i < upperFifty; i++) {
if (collection[i].ID != null && collection[i].ID != "undefined") {
cOptions = cOptions + "<option value=" + collection[i].ID + ">" + collection[i].Text + "</option>";
}
}
alert($(this).html());
$(this).append(cOptions);
$(this).append($("<option></option>").val((upperFifty + 1)).html("--Next 50--"));
var allhtml = ($(this).html());
$(this).trigger('refresh');
}
});