rstaib / jquery-bootgrid

Nice, sleek and intuitive. A grid control especially designed for bootstrap.
http://www.jquery-bootgrid.com
MIT License
972 stars 364 forks source link

ajax error event? #345

Open doodi-v1 opened 7 years ago

doodi-v1 commented 7 years ago

When you specify ajax:true, is there a way to also specify an error event? I've been unsuccessful finding this in the doc and I've tried adding the event to the bootgrid parameter directly and through the ajaxSettings to no avail. Example, in case my question is vague or incoherent:

$(mainGridID).bootgrid({
    ajax: true,
    ajaxSettings: {
        error: function(jqXHR,textStatus,errorThrown){
            if(jqXHR.status===400){
                document.location.reload();
            }else{
                console.log(jqXHR,textStatus,errorThrown);
                $(".notice").html("Error: "+errorThrown );
            }
        }
    },
    error: function(jqXHR,textStatus,errorThrown){
        if(jqXHR.status===400){
            document.location.reload();
        }else{
            console.log(jqXHR,textStatus,errorThrown);
            $(".notice").html("Error: "+errorThrown );
        }
    },...
derrekbertrand commented 7 years ago

Yeah. I can't find this in the docs either, and the docs say you can't override error.