Change options label of a @select_filter

Hello,



I’ve an img column type and I use the #select_filter on this column.

But instead of having the text of the cell (eg : /images/ico_fax.gif^Fax), I would like to have the image title.

So I use the onCollectValues event to change values of the select filter:



Xml Data :

<?xml version="1.0" encoding="UTF-8"?>



/images/ico_fax.gif^Fax









/images/ico_portable.gif^Portable











oGrid.attachEvent(“onCollectValues”, function(index){

if (index == 0) {

values = oGrid.collectValues(0);

for(i=0 ; i<values.length ; i++) {

values[i] = values[i].substr(values[i].lastIndexOf(’^’)+1);

}

return values;

}

else {

return true; //default processing

}

});



But the select is empty.

Could you help me please ?

collectValues() method can return array of column value only if all rows from the column is rendered. In you case “onCollectValue” method is called too early when no rows are loaded yet.
In you case better to change “img” cell so getValue() method will return necessary value. Please find more information about custom eXcell creation here dhtmlx.com/dhxdocs/doku.php?id=d … l_creation

Thank you for your answer.

I’ve created a new excell type and I change the column type to ‘ico’.
But is the select filter, there is the tag instead of the real value  specified if the setCvalue function.

Another problem is that the title attribute is cleared. Why ?

dhtmlxgrid.zip (212 KB)