problem with eXcell formating and sorting

according to the eXcell API doc :
obj.setCValue(formated_val,real_val);
grid should sort using real_val => he’s not.

should I miss something ?
using code below, “to date” is shown before other dates when sorting inside the grid.

here’s my code :

	function eXcell_colorcells(cell) {
		if (cell) { 
			this.cell = cell;
			this.grid = this.cell.parentNode.grid;
		}
		this.setValue = function(val) {
							var dispval = val;
							if (val=="2999-01-01") { 
								dispval = "to date";
								this.cell.style.color="#A00";
							}
							this.setCTxtValue(dispval,val); 
						}
	   
	}
	eXcell_colorcells.prototype = new eXcell;

another example : I have an eXcell renderer that adds spaces in int values …

this.setCValue(dispval,val);

val = raw value (ex: 15200)
dispval = value with spaces inside (ex: 15 200)

when sorting on this column, values are sorted like strings. it should be sorted on raw values (like int) according to the doc no ?
(of course I have setColSorting to int for this column)

thanks in advance.

using code below, “to date” is shown before other dates when sorting inside the grid.
Please, try to set the sorting type to “str”.
sorting works with the displayed value, so “to date” is not a number and cannot be used with “int” sorting type

when sorting on this column, values are sorted like strings. it should be sorted on raw values (like int) according to the doc no ?
(of course I have setColSorting to int for this column)
“int” sorting type is designed for sorting the integer numbers. which cannot contain spaces.

well, I don’t speak english very well, it’s hard for me to explain.
the real question behind these examples is :
I need to display values in a certain way (adding spaces, replacing char by another, etc …) BUT I want the grid to continue to deal with the real internal values (dates, ints, etc…).
example : showing numbers with spaces, but sorting them on the real internal value.

I though eXcell way was like a “display renderer”, which don’t affect the way that the grid are working with data internally.

But maybe there’s a better (or simpler) way ?

Let’s take an extreme example : I want to replace all number (0-9) with ‘*’ for non subscribers, but continue to sort on real internal values … how can I do that ?

Thanks …

Unfortunately in case of formating the cell’s value sorting or filtering will work only with the formated value but not the defined in dataset.
You may create a custom sorting type that will suit your formatted data:
docs.dhtmlx.com/doku.php?id=dhtm … om_sorting