Hi,
1. No, no error in the console window
2. I have the following search form:
<div id="COL1">
<div style="padding: 10px; vertical-align: middle; text-align: center; font-weight: bold;">Attività da pianificare</div>
<table class="userInteractionTable">
<tr>
<td>
<div class='well'>
<div class="row">
<div class='floating-label'>Dal</div>
<div class='floating-element'>
@Html.EJ().DatePicker("FromDate").Value(@System.DateTime.Today.AddYears(-1)).DateFormat("MM/yyyy")
</div>
<div class='floating-label'>Al</div>
<div class='floating-element'>
@Html.EJ().DatePicker("ToDate").Value(@System.DateTime.Today.AddMonths(1)).DateFormat("MM/yyyy")
</div>
<div class='floating-element'>
@Html.EJ().CheckBox("AllDates").Text("Tutte").Value("All")
</div>
</div>
<div class="row">
<div class='floating-label'>Località</div>
<div class='floating-element'>
<input id="cityInput" type="text" placeholder="Digita la località">
</div>
<div class='floating-label'>Raggio</div>
<div class='floating-element'>
<input type="number" value="10" min="0" id="radiusInput" name="radiusInput" autofocus />
</div>
<div class='floating-element'>
<form id="options">
<select id="unitSelector" name="unitSelector">
<option value="km">Kilometers</option>
<option value="mi">Miles</option>
<option value="ft">Feet</option>
<option value="mt">Metres</option>
<option value="in">Inches</option>
<option value="yd">Yards</option>
<option value="fa">Fathoms</option>
<option value="na">Nautical miles</option>
<option value="ch">Chains</option>
<option value="rd">Rods</option>
<option value="fr">Furlongs</option>
</select>
</form>
</div>
</div>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<div id="target">
@Html.EJ().WaitingPopup("target").ShowOnInit(true).ShowImage(true)
<div id="activitiesToPlanGrid" style="width: 100%">
@Html.Partial("../WorkActivity/WorkActivitiesToPlanPartial")
</div>
</div>
</td>
</tr>
</table>
</div>
$(document).ready(function () {
obj = $("#WorkActivitySchedule").data("ejSchedule");
$("#WorkActivitySchedule").ejSchedule("option", "tooltipSettings.enable", true);
$("#WorkActivitySchedule").ejSchedule("option", "tooltipSettings.templateId", "#tooltipTemp");
var input = document.getElementById('cityInput');
autocomplete = new google.maps.places.Autocomplete(input);
autocomplete.addListener('place_changed', function () {
syncActivitiesGrid();
});
});
function syncActivitiesGrid() {
var place = autocomplete.getPlace();
var objActGrid = $("#activitiesToPlanGrid").data("ejGrid");
debugger;
var range = $('#radiusInput').val();
var lat;
var lng;
if (!place.geometry) {
window.alert("Impossibile calcolare le coordinate per la località scelta!");
return;
}
var address = place.formatted_address;
var geocoder = new google.maps.Geocoder();
geocoder.geocode({ 'address': address }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
lat = results[0].geometry.location.lat();
lng = results[0].geometry.location.lng();
$.ajax({
type: "POST",
dataType: 'json',
contentType: 'application/json; charset=utf-8',
data: JSON.stringify({ cLat: lat, cLng: lng, range: $('#radiusInput').val() }),
url: "../../WorkActivity/WorkActivitiesToPlanRangePartial",
success: function (data) {
var objJSON = eval(data);
if (objJSON.count > 0) {
$("#WorkActivitiesGrid").ejGrid({
dataSource: data.result, // data must be array of json
refreshContent: true
});
} else {
var obj = $("#WorkActivitiesGrid").ejGrid("instance");
obj.model.filterSettings.filteredColumns.push({ field: "Id", operator: "equal", value: 0, matchcase: false, predicate: "and" });
obj.refreshContent();
}
},
error: function (xhr, ajaxOptions, thrownError) {
alert('Error during process: \n' + xhr.responseText);
}
});
} else {
console.log("Geocode was not successful for the following reason: " + status);
}
});
}
I hope this will help you.
3. I can't reproduce the issue because of different assembly versions...