1
動態調用select事件
我已經使用jQuery API創建標籤,並通過使用下面的代碼綁定在第二個選項卡中單擊一個事件處理程序:無法在標籤在jQuery的
$('#tabs').bind('tabsselect', function(event, ui) {
refreshRemoveUI(event,ui);
});
function refreshRemoveUI(event,ui) {
if(ui.index==1){
$.get('FrontServlet?operation=getAllQues',function(data) {
var html = "";
var questionsNum = data.split(",");
if(questionsNum!="") {
html += '<br/><input type=checkbox name=removeAllQuestionId id=removeAllQuestionId onclick="toggleAll(this.checked)"/> Select/Deselect All<br/>';
for(var i=0;i<questionsNum.length;i++){
html += '<br/><input type=checkbox name=removeQuestionId id=removeQuestionId /> ' + questionsNum[i];
}
$('#remove').show();
} else {
$('#remove').hide();
html = 'No question available in quiz';
}
$('#removequestions').html(html);
});
}
}
我想要調用關於Ajax請求的完成也並按照相同的綁定事件是什麼,我都試過,但沒有運氣:
$.get('FrontServlet?operation=remove&position='+val, function(data) {
$("#tabs li.ui-state-default:nth(1)").trigger("select");
});
任何想法的傢伙?
只是在這裏做一些猜測,因爲我不完全知道這件事,沒有一個工作樣本,它是一個重現問題的大量工作,但不應該''..]。trigger('tabselect ')'而不是'[..]。trigger('select')'? – Jasper