I have a checkbox on the marker if it is checked it should check its own row (only) but on the check, it performs no action.
the code i used for checkbox on marker
locations = ["Naqshbandi store muneer sahab moman pura", 31.5959959, 74.4222583, 597];
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0] + locations[i][3] + " <input type='checkbox' class='map-checked-box mr-1' data-id='"+ locations[i][3] +"' >");
infowindow.open(map, marker);
}
})(marker, i ));
}
this code should check checkbox of user row
$("body").delegate('.map-checked-box', "click", function(){
var dataID = $(this).data('id');
console.log(dataId);
var status = true;
if($(this).prop('checked') == false){
status = false;
}
$(".chk-by-map[value='"+dataID+"']").prop('checked', status);
});
but it is not working any help?
Aucun commentaire:
Enregistrer un commentaire