I’m experiencing a strange behaviour when I activate client-side filtering on a grid and I try to access its cell contents.
dhxGridLog = attachGrid();
with (dhxGridLog) {
//
setImagePath("codebase/imgs/");
setSkin("dhx_blue");
setStyle("font-size:small", "font-size:small", "font-size:small", "font-size:small");
//
attachEvent("onXLS", function(grid_obj) {
//
dhxWins.window("win_log").progressOn();
});
attachEvent("onXLE", function(grid_obj) {
//
grid_obj.attachHeader("#select_filter,#text_filter,#text_filter,#text_filter, , ,#text_filter,#select_filter,#select_filter,#select_filter,#select_filter,#numeric_filter,#text_filter");
grid_obj.sortRows(2, "str", "des");
//
dhxWins.window("win_log").progressOff();
});
//
loadXML("xml/grid.php?file=" + _file + "&" + noCache());
}
If I try to get the number of rows of the filtered grid it returns the correct result.
var rows = dhxGridLog.getRowsNum();
But if I loop through the filtered grid rows, retrieving the cells content, I get the ones of the non-filtered grid.
[code]var win_map = dhxWins.createWindow(“win_map”, 1, 1, w, h);
with (dhxWins.window(“win_map”)) {
//
setText(“Mappa”);
button(“park”).hide();
button(“minmax1”).hide();
center();
denyResize();
denyMove();
setModal(true);
//
var map = attachMap();
//
var infowindow = new google.maps.InfoWindow();
var marker, i, rows = dhxGridLog.getRowsNum();
var bounds = new google.maps.LatLngBounds();
var colors = new Array(“FF0000”, “00FF00”, “FFFF00”, “00FFFF”, “FF00FF”);
//
for (i = 0; i < rows; i++) {
//
var id = dhxGridLog.cells(i, 0).getValue().replace(",", “.”);
var lat = dhxGridLog.cells(i, 4).getValue().replace(",", “.”);
var lon = dhxGridLog.cells(i, 5).getValue().replace(",", “.”);
var col = colors[parseInt(id) % 5];
//
var pos = new google.maps.LatLng(lat, lon);
bounds.extend(pos);
marker = new google.maps.Marker({
position: pos,
map: map,
icon: “http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=” + id + “|” + col + “|000000”
});
google.maps.event.addListener(marker, ‘click’, (function(marker, i) {
return function() {
//
var inf = “”;
inf += “
inf += “” + dhxGridLog.cells(i, 1).getValue() + " " + dhxGridLog.cells(i, 2).getValue() + "
";
inf += dhxGridLog.cells(i, 6).getValue() + "
";
inf += dhxGridLog.cells(i, 7).getValue() + " " + dhxGridLog.cells(i, 8).getValue() + “(” + dhxGridLog.cells(i, 9).getValue() + ")
";
inf += “” + dhxGridLog.cells(i, 3).getValue() + “”;
inf += “
//
infowindow.setContent(inf);
infowindow.open(map, marker);
}
})(marker, i));
}
map.fitBounds(bounds);
}[/code]