excell row type

hi to everybody.

I need help in building an custo excell column

i wrote this function to symply show an up-Arrow or down-Arrow replacing the value number normally sorted descendant.(the number could be also negative):


function excell_roncli(cell) {
if (cell) {
this.cell.= cell;
this.grid = this.cell.parentNode.grid;
}
this.edit = function() {}
this.isDisabled = function() { return true;}
this.setValue = function(val) {
if (val>=0) {
this.setCValue("", val);
}
else {
this.setCValue("", val);
}
}
}
eXcell_roncli.prototype = new excell;


The function shows correctly the arrows, that initially are sorted by the sql query, but if i try to change the order o returning to descendant after sorting other columns the order is not correct and strange, while i should want show Arrows but mantaining the sort order based on original values.

What’s wrong ?

Many thanks as Always.

Please help !

Please i need help about my previous post !

I want to take this opportunity to inform you that there is an error in the documentation on line for grid.getColumnLabel method.

The syntax is correct but in the example you use getColLabel instead and this is a bit confusing the reader.

Thanks.

help help ! i need an answer please !

Hi Sematik,

Why do you give an answer to everybody but you avoid me ?

Hello, maurildo

I apologize for the delay with the answer to you.
The sorting functions sort the column by the value of the cell.
In your case you need to create your own custom sorting type.
Here you can find a tutorial with some examples:
docs.dhtmlx.com/grid__sorting.ht … ngfunction

Thanks Sematik,

I thought that building a custom excell should permit to control also ordering passing the correct value to getValue function but i don’t know how, doesn’ it ?

Many tanks as always

The sorting in the grid uses the cell values in any any kind of exCell. You should organize the value of your cell in your custom exCell or create a custom sorting type.

Hi sematik,

OK for your answer but in my custom excell can i sort using the real_value instead of the formatting_value (an image in my case) ?

In the case to built a custom_sort as you indicated how can i catch the real value of the cell instead of the image ?

Thanks

Please help

Please, try to use:

function excell_roncli(cell) { if (cell) { this.cell.= cell; this.grid = this.cell.parentNode.grid; } this.edit = function() {} this.isDisabled = function() { return true;} this.setValue = function(val) { this.cell.real_value = val; if (val>=0) { this.setCValue("<img src='icons/up_small.gif'/>", val); } else { this.setCValue("<img src='icons/up_down.gif'/>", val); } } this.getValue=function(){ return this.cell.real_value; } } eXcell_roncli.prototype = new excell;

Many many many thanks Sematik, you’re great.

It runs perfectly, but as often happens you use functions or commands that are not documented.

Is it possible to have a complete documentation of the Suite ? Online Documentation is good but not complete !

Thanks again.

In the provided example i don’t us any specific API.

function excell_roncli(cell) { if (cell) { this.cell.= cell; this.grid = this.cell.parentNode.grid; } this.edit = function() {} this.isDisabled = function() { return true;} this.setValue = function(val) { // saving the original value of your cell before the formatting to any custom variable this.cell.real_value = val; if (val>=0) { this.setCValue("<img src='icons/up_small.gif'/>", val); } else { this.setCValue("<img src='icons/up_down.gif'/>", val); } } this.getValue=function(){ //return the saved value in the getValue() function return this.cell.real_value; } } eXcell_roncli.prototype = new excell;

Hi Sematik,

I don’t talk about api but for istance:

this.cell.real_value

is a property of cell that i didn’t find in any part of documentation !

For that i requested e complete reference of the library.

this.cell.real_value is a custom property, created on the fly to save the needed value.
You may replace it with “this.cell.my_value”, “this.cell.some_needed_value”, etc. there is no matter.

Hi Sematik,

I understood but now i’ve another problem. i’d like that this custom column when shown in grid should permit tooltip showing the famous real_value.

i tried two ways.

  1. i put in my code
    eXcell_roncli.prototype.getTitle = eXcell_roncli.prototype.getValue;

and i set “true” in grid.enableTooltips.

DOESN’T RUN

  1. i put in prototype function definition.

this.getTitle=function() { return this.cell.real_value;}

and i set “true” in grid.enableTooltips.

DOESN’T RUN.

The tooltips is never shown.

Please Help

Please, try to add tooltips right to your images.

Thank you Sematik but i solved , partially, in another way.

I used getTitle function in eXcell definition and it runs correctly in a normal grid but there is another problem:

in another grid this same eXcell is used in a column with calculation.

roncli[=if(c4>0){(c3-c4)/c4*100}else{100}]

The calculation runs and also images are shown correctly. The only problem is the tooltip that is not shown.

In my eXcell i defined the getTitle function in this way:

this.getTitle=function() {return this.cell.real_value} // real_value is set in setValue function.

in case of calculation column is enough or i ve to do something else ?

many thanks.

Please an answer
thank you