0

I have a requirement to validate the fields before bootgrid loads the data. The field is inside the bootgrid (Date search). So, i was trying

var grid = $("#grid").bootgrid({
    ajax: true,
    url: "url",
    caseSensitive: false,
    rowCount: [20, 50, 75, 100],
    searchSettings: {
        delay: 1000,
        characters: 2
    },
    responseHandler : function (response) { 
        // some code 
    },
    labels: {
        search: "Search"
    }

}).on("load.rs.jquery.bootgrid", function (e)
        {

    if(!$("#drpDwnInput").val() ) {

        e.preventDefault();
        e.stopImmediatePropagation();
        e.stopPropagation();
        return false;
        } else {
            console.log("something isnt right");
        }


});

When validation fails here, i want bootgrid to stop processing the request. Even though i stop the probagation, bootgrid still hits my service and loads the data. How do i prevent bootgrid to stop processing in case of validation errors?

Arvind SJ
  • 1
  • 1
  • is this the whole code? what happens after you stop all the progagations? – transient_loop Oct 13 '17 at 00:16
  • This is not the whole code. I have the bootgrid call my service thru ajax. var grid = $(gridId).bootgrid({ // ajax call and response handler})..on("load.rs.jquery.bootgrid", function (e){}); After the stopprobagation, i expect bootgrid to stop processing. But it still hits the ajax call as defined in the bootgrid and loads the data – Arvind SJ Oct 13 '17 at 01:17

0 Answers0