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?