case sensitive filter

Hi,
I’m using a grid of three columns. One of these columns has the type coro.
We have decided to have a “Case insensitive sorting” ont this column.
In fact, we have implemented the function str_custom discribed in the documentation.
When we look at the cell it works .

I have two questions :

  1. When we try to to sort the column with a click on the header we have got a javascript error : " Object doesn’t support this property or method "
    Where am i wrong ?
  2. We have positionned a filter “#select_filter”, on this column. When we look at the filter, it is case sensitive.
    Is there a way to get in the filter a non case sensitive sort ?

Here is my code :

function doInitMyGridActions(){
actionsGrid = new dhtmlXGridObject(‘actions_container’);
actionsGrid.setImagePath(folderimagename);
actionsGrid.setHeader(“Id, Utilisateur, Groupe”);
// Pour le dataprocessor
actionsGrid.setColumnIds(“id, utilisateur,groupe”);
actionsGrid.attachHeader(“#text_filter, ,#select_filter”);
actionsGrid.setInitWidths(“200,,”);
actionsGrid.setColAlign(“left,left,left”);
actionsGrid.setColSorting(“str,str,str_custom”);
actionsGrid.setColTypes(“ro,combo,coro”);

<?php foreach($groupes->TableauData as $index=>$valeur) { echo 'actionsGrid.getCombo(2).put(' . $valeur['id_groupe'] . ','. '"'.$valeur['libelle_groupe'] . '");'; } ?>

//Skin
actionsGrid.setSkin(“light”);

// events
actionsGrid.enableColumnMove(false);
actionsGrid.enableColumnAutoSize(true);

//Pagination
actionsGrid.enablePaging(true, 20, null, “pagingArea”, true, “recinfoArea”);
actionsGrid.setPagingSkin(“toolbar”);

//Option de serialization
actionsGrid.init();

//Combo
var combo = actionsGrid.getColumnCombo(1);
combo.enableFilteringMode(true);
combo.loadXML(fileldap);

actionsGrid.loadXML(filename);

}

function str_custom(a,b,order){ //the name of the function must be > than 5 chars
if (order==“asc”)
return (a.toLoweCase()>b.toLoweCase()?1:-1);
else
return (a.toLoweCase()<b.toLoweCase()?-1:1);
}




If you are using dyn. loading - the client side sorting will not work for you ( because grid can’t sort data which is not loaded ) - it can be a reason of js error during sorting.

Caused by filtering against coro column ( will works case insensitive for plain column types )
You can try to fix situation by changing next line in dhtmlxgridcell.js

this.get=function(key){ for (var i = 0; i < this.keys.length; i++){ if (this.keys[i] == key){

as

this.get=function(key){ for (var i = 0; i < this.keys.length; i++){ if (this.keys[i].toString().toLowerCase() == key.toString().toLowerCase()){