diff --git a/addons/default/visiosoft/location-module/resources/js/filterLocation.js b/addons/default/visiosoft/location-module/resources/js/filterLocation.js index a7846951c..3b2153e02 100644 --- a/addons/default/visiosoft/location-module/resources/js/filterLocation.js +++ b/addons/default/visiosoft/location-module/resources/js/filterLocation.js @@ -19,7 +19,8 @@ $('.filter-country-btn').on('click', function () { $('.filter-location-modal .countries').html(null_msg); else if ($('input[name="country"]').val() != ""){ $.each(selected__country_request.split(','), function (index, value){ - $(".filter-location-body .countries li[data-id='" + value.trim() + "'] input[type='checkbox']").prop('checked', true); + console.log(value.trim()) + $(".filter-location-body .countries li[data-id='" + value.trim() + "'] input[type='checkbox']") }) } resolve(); @@ -38,6 +39,7 @@ $('.filter-country-btn').on('click', function () { //City $('.filter-city-btn').on('click', function () { var countries_value = $('input[name="country[]"]').val(); + countries_value += ',' + defaultCountry var selected__city_request = $('input[name="city[]"]').val(); if (cities == undefined || $(this).attr('data-parent') != countries_value) { $(this).attr('data-parent', countries_value); @@ -242,10 +244,11 @@ function locationCrud(params, url, type, beforeSend, callback) { } function item(field_name, id, value, abv = '') { + var selected = defaultCountry === id ? "checked" : ""; if (field_name === 'country') { return '