3.2.0

case sensitivity

Hi Alex,
Thank YOu for ur wonderful grid. I have two issues related to the gird. In one of my column i have a data as data1, data1, !@#$%^&*, etc when i click on this particular column am getting the column sorted as data1, !@#$%^&*, data1
Also, can u help me out to make my sorting case sensitive or insensitive.
am using version 1
Any help for this.
May 7,
The values for sorting are obtained by the setDataProperty method. You can attach functions to this method, to let javascript know what kind of data is in the column.

In the below example, there is a grid myGrid with 2 columns (data is stored in the array myData). The first column contains case-sensitive strings, the second case-insensitive ones.

//set data types for column sorting
function string(text){return text;};  //case sensitive strings
function stringCi(text){return text.toLowerCase();};  //case insensitive strings

//setDataProperty for the columns
var toValue = [string,stringCi]; //[column1, column2]
myGrid.setDataProperty('value', function(i,j){return toValue[j](my_data[i][j]);});


Good luck!
Rekcor
May 15,

This topic is archived.

See also:


Back to support forum