0
I have a problem at Kendo’s grid. What happens is that I have a grid with several columns, among them, I have one with the last position sent by the tracker. This column has the data in hyperlink format and when clicked on it, will open a new screen showing the position on the map.
Up to this point is ready, but when I click on the hyperlink and I DO NOT select the grid line, it simply does not pick the coordinate, because when I click I send the latitude and longitude of the position.
In tests I saw that it would be necessary to select the grid at the time of the click on the link. But how do I do this?
Follow the grid mount code:
$("#grdUltimasPosicoes").kendoGrid({
columns: [
{
field: "Ignicao",
title: "Ign.",
template: "<input class='check_row' type='checkbox' #= Ignicao === true ? checked='checked' : '' # disabled='disabled'/>",
width: "70px"
},
{
field: "Posicao",
title: "Posição",
width: "300px",
template: "<a href='javascript:Maps()'>#=Posicao#</a>",
attributes: {style: "background-color: #= Cor #"}
},
{field: "DataEvento", title: "Data/Hora", format: "{0: dd/MM/yyyy HH:mm}", width: "135px"},
{field: "DataGPS", title: "Data GPS", format: "{0: dd/MM/yyyy HH:mm}", width: "135px"},
{field: "Rpm", title: "RPM", width: "80px"},
{field: "Velocidade", title: "Vel.", width: "70px"},
{field: "PotenGPS", title: "Nº GPS", width: "95px"},
{field: "PotenGPRS", title: "Nº GPRS", width: "100px"}
],
change: function (e) {
if (this.select != null) {
latlng = this.dataItem(this.select());
Latitude = latlng.Latitude;
Longitude = latlng.Longitude;
}
},
groupable: false,
sortable: true,
editable: false,
filterable: true,
scrollable: true,
pageable: false,
selectable: "row",
height: 250,
dataSource: posicoes
});
And this is the function called to open the new screen with the map:
function Maps() {
acessaTela('HelpDesk', 'MapaPosicao', 'Novo', '1', 'Posição no Mapa', '495', '650', VeiculoSelecionado + '|' + Latitude + '|' + Longitude);
}