I have a table that I've made sortable using the jQuery plugin Tablesorter 2.0. On the same page, I have a Google Map that displays a marker for each item in the table. Now, I want to make it so that when a <tr>
is hovered, the corresponding marker on the Google Map is highlighted. I also want to do the vice versa, where clicking on a marker will highlight the table row.
The problem I'm running into is that I don't know how to associate a marker with a table row. I can get the coordinates and markers for each item by using (in Javascript):
var list = [
<% foreach (var item in Model) { %>
new GMarker(new GLatLng(<%= item.Latitude %>, <%= item.Longitude %>)),
<% } %> ];
and this works fine, but I don't know how to then relate this array of markers with the table rows, considering that the rows can be sorted. Any help in the right direction would be appreciated, as I'm pretty stumped right now.