Hi,
The combo filter in a grid default shows the value of the options in the grid.
Is there a way to get the text in the combo.
I tried the following approach:
function RPRO()
{
grid.attachEvent("onCollectValues",collectComboValues);
grid.attachEvent("onFilterStart",filterGrid);
grid.attachHeader("#text_filter,,#select_filter,#text_filter,#text_filter,#combo_filter,");
grid.setSizes();
}
function collectComboValues(index){
if (index==5){
var c={}; var f=[];
for (var i=0; i<this.getRowsNum(); i++){
this.render_row(i);
var text=this.cellByIndex(i,5).getTitle();
c[text]=true;
}
for (d in c)
if (c[d]===true) f.push(d);
return f.sort();
}
}
function filterGrid(indexes,values){
var i=indexes.indexOf(5);
if (values[i]){
var combo=grid.getFilterElement(5);
var combo_value=combo.getOptionByLabel(values[i]).value;
alert("COMBOVALUE: " + combo_value);
this.filterBy(5,function(value){
return (value.toString().toLowerCase()==combo_value.toString().toLowerCase());
});
return false;
}
return true;
}
But the variable value returns the value and combo_value returns the text.