Custom Group Format for one column in grid

Hi Sematik

Thanks again for your very prompt reply. Unfortunately the custom shortcut does not provide access to the row id and therefore to the other cells in the row.

If I could have access to the row id as the #stats were being created then I could include values from other cells in the row…which is what I’m trying to achieve.

However I very much appreciate your time in responding to these questions.

Hi I have a custom column stat function as follows:

    dhtmlXGridObject.prototype._g_stat_test=function(res,val,count)
    {
        alert('gh / '+val);
        //PaxNo = Number(val.substring(val.indexOf('Pax Nos:')+9));
        //res += PaxNo;
        return 'ABC';
    }

The way I understand it the first variable - res is the result of this function from previous row in the group.
The second variable - val is supposed to be the content of the current cell during the iteration over each row in group.
The third variable count is supposed to represent the no. of rows in the group.

In my cell I have an alphanumeric value. However the above alert shows val = 0.

Am I doing something wrong here or is val only expected to be a number?

Thanks
Purvez

Hi,

The code converts a value of cell to a number before sending it to the group function ( using default stat operations with non-numeric value has no sense )

Hi Stanislav

Thanks very much for your response. You wrote :

" using default stat operations with non-numeric value has no sense"

I agree with that, but the whole point of the ‘custom’ stat operations is that it is NOT the default.
Therefore having access to the raw cell data is necessary to create a ‘custom’ stat operation.

Purvez

hi sematik :slight_smile:
I did as you said. it’s so good.
and now I want get value in different collumn
example:
dhtmlXGridObject.prototype._g_stat_total=function(c,n,i){
//get value of different cell in a same row
return c+n;
}
can you help me?
sorry my English not good

Unfortuantely it is not available.