0

我尝试将引导多选与 jquery ajax 一起使用。执行 ajax 时,多选按钮不起作用。您可以在这里看到问题:http: //www.doyleia.com/anazitisi-ergasias在最后一个多选中。

阿贾克斯代码:

function runAjax(tags, contracts, educations, towns) {

$(document).ajaxStart(function(){
    $("#wait").css("display", "block");
});
$(document).ajaxComplete(function(){
    $("#wait").css("display", "none");
});
$.ajax({
    url: 'http://www.doyleia.com/anazitisi-ergasias?' + tags + '&' + contracts + '&' + educations + '&' + towns,
}).done(function(data){
    // destroy I used it because builded again the multiselect button after ajax
    $('.multi-boot-select').multiselect('destroy');
    var $html = $(data);
    //hide within that object
    $html.find('.form-for-hide').hide();
    $html.find('p.hidden').removeClass('hidden');
    // insert the object
    $('div.load-jobs').html($html);
});

}

4

1 回答 1

0

我已经像下面这样更改了 ajax,现在它可以工作了:

function runAjax(tags, contracts, educations, towns) {

$(document).ajaxStart(function(){
    $("#wait").css("display", "block");
});
$(document).ajaxComplete(function(){
    $("#wait").css("display", "none");
});
$.ajax({
    url: 'http://www.doyleia.com/anazitisi-ergasias?' + tags + '&' + contracts + '&' + educations + '&' + towns,
}).done(function(data){
    // destroy I used it because builded again the multiselect button after ajax
    var $html = $(data);
    //hide within that object

    var finalGet =  $html.find('.row-to-take');

    //$html.find('.form-for-hide').hide();
    $html.find('.hidden.alert.alert-danger').removeClass('hidden');

    // insert the object
    $('div.load-jobs').html(finalGet);
});

}

于 2015-10-29T08:24:36.130 回答