function SearchLocationResults(search) {
$filter = new Array();
var leaseuid = null, complexuid = null;
if (search == true) {
if ($("#baseLocationViewModel_ComplexUId").data("kendoDropDownList").value() != '' && $("#baseLocationViewModel_ComplexUId").data("kendoDropDownList").value() != null && $("#baseLocationViewModel_ComplexUId").data("kendoDropDownList").value() != undefined) {
$filter.push({ field: "Driver", operator: "isequalto", value: $("#baseLocationViewModel_DriverUId").data("kendoDropDownList").value() });
complexuid = $("#baseLocationViewModel_ComplexUId").data("kendoDropDownList").value();
}
if ($("#baseLocationViewModel_MasterUId").data("kendoDropDownList").value() != '' && $("#baseLocationViewModel_MasterUId").data("kendoDropDownList").value() != null && $("#baseLocationViewModel_MasterUId").data("kendoDropDownList").value() != undefined) {
$filter.push({ field: "LeaseUId", operator: "isequalto", value: $("#baseLocationViewModel_MasterUId").data("kendoDropDownList").value() });
leaseuid = $("#baseLocationViewModel_MasterUId").data("kendoDropDownList").value();
}
}
$(".loadermodel").removeClass('d-none');
$.ajax({
url: '/Keys/Keys/Grid_KeyLocationRead',
type: "POST",
dataType: "json",
contentType: 'application/json; charset=utf-8',
async: false,
data: JSON.stringify({
request: $filter, schedule: $("#baseLocationViewModel_Schedule").val(), driver: $("#baseLocationViewModel_DriverUId").data("kendoDropDownList").value(), _complexUId: complexuid, _leaseUId: leaseuid
}),
cache: false,
success: function (result) {
$("#SearchResultsGridLocation").data('kendoGrid').dataSource.data([]);
$("#SearchResultsGridLocation").data('kendoGrid').dataSource.data(result);
$(".loadermodel").addClass('d-none');
},
error: function (err) {
$(".loadermodel").addClass('d-none');
}
});
}