[code]
// we cant use onCollectValues, it will not add value part of options, just text part is used
for (var databaseIndex = 0; databaseIndex < grid.getColumnsNum(); databaseIndex++) { //console.log(grid.getFilterElement(databaseIndex));
var $filterElement = $(grid.getFilterElement(databaseIndex)); //console.log($filterElement);
if ($filterElement.is(‘select’)) {
// i = index before column move! you need to get actual index by columnId
var columnIndex = $.grid.getColumnIndexByDatabaseIndex(grid, databaseIndex);
var combo = grid.getCombo(columnIndex); //console.log(combo);
$filterElement.empty();
var option = $('<option></option>').attr("value", "").text("?");
$filterElement.append(option);
var keys = combo.keys;
var values = combo.values;
$.each(keys, function (index, key) {
var value = values[index];
var option = $('<option></option>').attr("value", key).text(value);
$filterElement.append(option);
});
}
}[/code]
after data is load from xml, i empty the filterelements with select, get combo of column where the all values and keys are specified and replace the options of filterelement
but you must be carefull, bcs grid.getFilterElement( there must be index before the columns are moved ) and grid.getCombo( there must be index after the columns are moved, actual index of column )
lot of missunderstanding caused by handling indexes
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan