Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Wolfgang Philipp on Jun 13, 2008 01:18
open dhtmlx forum
custom sort not working

Hello there!

It seems custom sorting is not working in my version. I still use Professional Version 1.4, since I started to develop application before version 1.5 was available.

I defined the sort types by:

mygrid.setColSorting(str,str,sort_custom,sort_custom,...);

Then i have this function:

function sort_custom(a,b,order)
{
alert (order);
}

I just tried if function is entered and it seems it is not. It doesnt alert anything. I think files have some errors or anything else.

How can i fix it?

And: How can i upgrade from 1.4 to 1.5 in an existing application? Do I only need to overwrite old DHTML files or is there any risk that application gets inconsistent when i do this?

Thx in advance!
Answer posted by Support on Jun 13, 2008 02:54
The local samples of dhtmlxgrid 1.4 works fine with custom sorting , there were no known issues related to sorting.
Please be sure that sort_custom function was already defined on moment of setColSorting call.

You can check  next sample inside your package
    samples/pro_sort.html

If problem still occurs for you - please contact us directly at support@dhtmlx.com - we may send the latest build of dhtmlxgrid 1.4 ( it contains all fixes before 1.5 releasing, and may resolve some issues )

>> And: How can i upgrade from 1.4 to 1.5 in an existing application? Do I only need to overwrite old DHTML files or is there any risk that application gets inconsistent when i do this?
There were no significant changes in logic and API fully backward compatible, so just updating js files will be enough
Latest version of dhtmlxgrid for now is 1.6 - upgrade for 1.6 is bit more complex because of changes in event system and paging extension.

Answer posted by Wolfgang Philipp on Jun 13, 2008 05:57
I am sure that sort_custom function is already defined on moment of setColSorting call, but it is still not working. When I initialize the JS-File and call sort_custom function (for ex sort_custom(1,2,"asc")) anywhere in the script for test purposes, it does enter, but it never enters function when I click on the header to sort a column.

Already checked the sample and I am quite sure I didn't do any mistake...

I had these problems before in another respect, I sent you all my files regarding this issue and answer was that it was working fine at your side but it never worked on my side! So I guess there is still an issue with your source files.
Answer posted by Support on Jun 13, 2008 07:59
If problem still occurs for you - please send any kind of sample where it can be reconstructed ( or any kind of demo link ) to support@dhtmlx.com

The custom sorting will not be call ( in dhtmlxgrid 1.4 )
- when smart rendering used
- onBeforeSorting event attached, and it doesn't returns true
- custom sorting in left part of splitted grid may be problematic in some cases
Answer posted by Wolfgang Philipp on Jun 17, 2008 01:47
It is still not working. I tried already all of these things and function is just never entered. I am quite sure that it has something to do with the source files. I can send you my files. But there is only a alert-function in my custom sorting function which is never shown. Could it be that custom sorting is not working for TreeGrid? Because I am using it in this case!

Here is initialisation of grid (some headers are dynamic):

function initOrganisationGrid(year,quarter)
{
    myGridbox = new dhtmlXGridObject('gridbox');
    myGridbox.setImagePath(documentRoot+"/include/dhtmlx/imgs/");
    myGridbox.setSkin("gray");
    myGridbox.enableColumnAutoSize(true);
    quarters = getQuarters(year,quarter);
    myGridbox.setHeader("Organisation / Customer Description,12NC,<span style=\"color:#008000\";>"+quarters[0]+" (EUR)</span>,<span style=\"color:#008000\";>"+quarters[1]+" (EUR)</span>,<span style=\"color:#008000\";>"+quarters[2]+" (EUR)</span,<span     style=\"color:#008000\";>"+quarters[3]+" (EUR)</span>,<span style=\"color:#5F5F5F\";>"+quarters[4]+" (EUR)</span>,<span style=\"color:#5F5F5F\";>"+quarters[5]+" (EUR)</span>,<span style=\"color:#5F5F5F\";>"+quarters[6]+" (EUR)</span>,<span                 style=\"color:#5F5F5F\";>"+quarters[7]+" (EUR)</span>,Status,Region InvoiceTo, Country InvoiceTo, Invoice From");
    myGridbox.setInitWidths("320,90,55,55,55,55,55,55,55,55,45,65,85,65");
    myGridbox.enableResizing("true,true,true,true,true,true,true,true,true,true,true,true,true,true");
    myGridbox.setColAlign("left,left,right,right,right,right,right,right,right,right,center,left,left,left");
    myGridbox.setColTypes("tree,link,rocustom,rocustom,rocustom,rocustom,rocustom,rocustom,rocustom,rocustom,img,ro,ro,ro");
    myGridbox.setColSorting("str,str,sort_custom,sort_custom,sort_custom,sort_custom,sort_custom,sort_custom,sort_custom,sort_custom,str,str,str,str");
    myGridbox.enableAlterCss("gridEven","GridUneven");
    myGridbox._srdh=rowHeight;
    myGridbox.init();
    try{
        myGridbox.setOnLoadingEnd(loadingEnd);
    }catch(e){}
    myGridbox.setOnLoadingStart(showLoading);
    //window.s_col=1;
    myGridbox.enableSmartXMLParsing(true);
    organisationReloadGrid();
}

function organisationReloadGrid()
{
    myGridbox.clearAll();
    myGridbox.kidsXmlFile = "ajax/getOrganisationList.php";
    myGridbox.loadXML("ajax/getOrganisationList.php");
}

function sort_custom(a,b,order)
{
    alert("a: "+a);
    alert("b: "+b);
    alert("order: "+order);
    alert ("test");
}

Here is the XML which is returned:

<rows parent="o2"><row id="o2_p139" xmlkids="">
<cell image="spacer.gif"><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument
(139,'240325228828-APPLE','ORGANISATION')">APPLE (45102)</a>]]></cell>
<cell><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument(139,'240325228828-APPLE'
,'ORGANISATION')">2403 252 28828</a>]]></cell>
		<cell><![CDATA[#008000_.244]]></cell>
		<cell><![CDATA[#008000_.244]]></cell>
		<cell><![CDATA[#008000_.244]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[/docnum/images/greenball.gif]]></cell>
		<cell><![CDATA[<span style="color:#FF421E;">AMERICAS</span>]]></cell>
		<cell><![CDATA[<span style="color:#4181CE;">USA</span>]]></cell>
		<cell><![CDATA[EUROPE]]></cell>
	</row>
<row id="o2_p322" xmlkids="">
<cell image="spacer.gif"><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument
(322,'240326000001-APPLE','ORGANISATION')">APPLE (45102)</a>]]></cell>
<cell><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument(322,'240326000001-APPLE'
,'ORGANISATION')">2403 260 00001</a>]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[/docnum/images/greenball.gif]]></cell>
		<cell><![CDATA[<span style="color:#FF421E;">AMERICAS</span>]]></cell>
		<cell><![CDATA[<span style="color:#4181CE;">USA</span>]]></cell>
		<cell><![CDATA[EUROPE]]></cell>
	</row>
<row id="o2_p383" xmlkids="">
<cell image="spacer.gif"><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument
(383,'240326000017-APPLE','ORGANISATION')">APPLE (45102)</a>]]></cell>
<cell><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument(383,'240326000017-APPLE'
,'ORGANISATION')">2403 260 00017</a>]]></cell>
		<cell><![CDATA[#008000_.4495]]></cell>
		<cell><![CDATA[#008000_.4495]]></cell>
		<cell><![CDATA[#008000_.4414]]></cell>
		<cell><![CDATA[#008000_.4286]]></cell>
		<cell><![CDATA[#5F5F5F_.4222]]></cell>
		<cell><![CDATA[#5F5F5F_.4174]]></cell>
		<cell><![CDATA[#5F5F5F_.4158]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[/docnum/images/greenball.gif]]></cell>
		<cell><![CDATA[<span style="color:#FF421E;">AMERICAS</span>]]></cell>
		<cell><![CDATA[<span style="color:#4181CE;">USA</span>]]></cell>
		<cell><![CDATA[EUROPE]]></cell>
	</row>
<row id="o2_p384" xmlkids="">
<cell image="spacer.gif"><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument
(384,'240326000017-FOXCONN (APPLE)','ORGANISATION')">FOXCONN (APPLE) (45107)</a>]]></cell>
<cell><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument(384,'240326000017-FOXCONN
 (APPLE)','ORGANISATION')">2403 260 00017</a>]]></cell>
		<cell><![CDATA[#008000_.4495]]></cell>
		<cell><![CDATA[#008000_.4495]]></cell>
		<cell><![CDATA[#008000_.4414]]></cell>
		<cell><![CDATA[#008000_.4286]]></cell>
		<cell><![CDATA[#5F5F5F_.4222]]></cell>
		<cell><![CDATA[#5F5F5F_.4174]]></cell>
		<cell><![CDATA[#5F5F5F_.4158]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[/docnum/images/greenball.gif]]></cell>
		<cell><![CDATA[<span style="color:#FF421E;">AMERICAS</span>]]></cell>
		<cell><![CDATA[<span style="color:#4181CE;">USA</span>]]></cell>
		<cell><![CDATA[EUROPE]]></cell>
	</row>
<row id="o2_p385" xmlkids="">
<cell image="spacer.gif"><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument
(385,'240326000017-FOXCONN (APPLE)','ORGANISATION')">FOXCONN (APPLE) (45109)</a>]]></cell>
<cell><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument(385,'240326000017-FOXCONN
 (APPLE)','ORGANISATION')">2403 260 00017</a>]]></cell>
		<cell><![CDATA[#008000_.4495]]></cell>
		<cell><![CDATA[#008000_.4495]]></cell>
		<cell><![CDATA[#008000_.4414]]></cell>
		<cell><![CDATA[#008000_.4286]]></cell>
		<cell><![CDATA[#5F5F5F_.4222]]></cell>
		<cell><![CDATA[#5F5F5F_.4174]]></cell>
		<cell><![CDATA[#5F5F5F_.4158]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[/docnum/images/greenball.gif]]></cell>
		<cell><![CDATA[<span style="color:#FF421E;">GR.CHINA</span>]]></cell>
		<cell><![CDATA[<span style="color:#4181CE;">Hong Kong</span>]]></cell>
		<cell><![CDATA[EUROPE]]></cell>
	</row>
<row id="o2_p414" xmlkids="">
<cell image="spacer.gif"><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument
(414,'240326000029-APPLE','ORGANISATION')">APPLE (45102)</a>]]></cell>
<cell><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument(414,'240326000029-APPLE'
,'ORGANISATION')">2403 260 00029</a>]]></cell>
		<cell><![CDATA[#008000_.5458]]></cell>
		<cell><![CDATA[#008000_.5458]]></cell>
		<cell><![CDATA[#008000_.5458]]></cell>
		<cell><![CDATA[#008000_.5329]]></cell>
		<cell><![CDATA[#5F5F5F_.5265]]></cell>
		<cell><![CDATA[#5F5F5F_.5201]]></cell>
		<cell><![CDATA[#5F5F5F_.5137]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[/docnum/images/greenball.gif]]></cell>
		<cell><![CDATA[<span style="color:#FF421E;">AMERICAS</span>]]></cell>
		<cell><![CDATA[<span style="color:#4181CE;">USA</span>]]></cell>
		<cell><![CDATA[EUROPE]]></cell>
	</row>
<row id="o2_p422" xmlkids="">
<cell image="spacer.gif"><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument
(422,'240326000031-APPLE','ORGANISATION')">APPLE (45102)</a>]]></cell>
<cell><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument(422,'240326000031-APPLE'
,'ORGANISATION')">2403 260 00031</a>]]></cell>
		<cell><![CDATA[#008000_.5458]]></cell>
		<cell><![CDATA[#008000_.5458]]></cell>
		<cell><![CDATA[#008000_.5458]]></cell>
		<cell><![CDATA[#008000_.5329]]></cell>
		<cell><![CDATA[#5F5F5F_.5265]]></cell>
		<cell><![CDATA[#5F5F5F_.5201]]></cell>
		<cell><![CDATA[#5F5F5F_.5137]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[/docnum/images/greenball.gif]]></cell>
		<cell><![CDATA[<span style="color:#FF421E;">AMERICAS</span>]]></cell>
		<cell><![CDATA[<span style="color:#4181CE;">USA</span>]]></cell>
		<cell><![CDATA[EUROPE]]></cell>
	</row>
<row id="o2_p397" xmlkids="">
<cell image="spacer.gif"><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument
(397,'240326000032-APPLE','ORGANISATION')">APPLE (45102)</a>]]></cell>
<cell><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument(397,'240326000032-APPLE'
,'ORGANISATION')">2403 260 00032</a>]]></cell>
		<cell><![CDATA[#008000_.504]]></cell>
		<cell><![CDATA[#008000_.4912]]></cell>
		<cell><![CDATA[#008000_.4912]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[/docnum/images/greenball.gif]]></cell>
		<cell><![CDATA[<span style="color:#FF421E;">AMERICAS</span>]]></cell>
		<cell><![CDATA[<span style="color:#4181CE;">USA</span>]]></cell>
		<cell><![CDATA[EUROPE]]></cell>
	</row>
<row id="o2_p395" xmlkids="">
<cell image="spacer.gif"><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument
(395,'240326000032-FOXCONN SHENZEN (APPLE)','ORGANISATION')">FOXCONN SHENZEN (APPLE) (26100)</a>]]><
/cell>
<cell><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument(395,'240326000032-FOXCONN
 SHENZEN (APPLE)','ORGANISATION')">2403 260 00032</a>]]></cell>
		<cell><![CDATA[#008000_.504]]></cell>
		<cell><![CDATA[#008000_.4912]]></cell>
		<cell><![CDATA[#008000_.4912]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[/docnum/images/greenball.gif]]></cell>
		<cell><![CDATA[<span style="color:#FF421E;">GR.CHINA</span>]]></cell>
		<cell><![CDATA[<span style="color:#4181CE;">China</span>]]></cell>
		<cell><![CDATA[EUROPE]]></cell>
	</row>
<row id="o2_p398" xmlkids="">
<cell image="spacer.gif"><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument
(398,'240326000032-HON HAI SHENZEN (APPLE)','ORGANISATION')">HON HAI SHENZEN (APPLE) (45105)</a>]]><
/cell>
<cell><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument(398,'240326000032-HON
 HAI SHENZEN (APPLE)','ORGANISATION')">2403 260 00032</a>]]></cell>
		<cell><![CDATA[#008000_.504]]></cell>
		<cell><![CDATA[#008000_.4912]]></cell>
		<cell><![CDATA[#008000_.4912]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[/docnum/images/greenball.gif]]></cell>
		<cell><![CDATA[<span style="color:#FF421E;">GR.CHINA</span>]]></cell>
		<cell><![CDATA[<span style="color:#4181CE;">China</span>]]></cell>
		<cell><![CDATA[EUROPE]]></cell>
	</row>
<row id="o2_p396" xmlkids="">
<cell image="spacer.gif"><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument
(396,'240326000032-NXP RDC HONG KONG','ORGANISATION')">NXP RDC HONG KONG (45017)</a>]]></cell>
<cell><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument(396,'240326000032-NXP
 RDC HONG KONG','ORGANISATION')">2403 260 00032</a>]]></cell>
		<cell><![CDATA[#008000_.504]]></cell>
		<cell><![CDATA[#008000_.4912]]></cell>
		<cell><![CDATA[#008000_.4912]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[/docnum/images/greenball.gif]]></cell>
		<cell><![CDATA[<span style="color:#FF421E;">GR.CHINA</span>]]></cell>
		<cell><![CDATA[<span style="color:#4181CE;">China</span>]]></cell>
		<cell><![CDATA[EUROPE]]></cell>
	</row>
<row id="o2_p164" xmlkids="">
<cell image="spacer.gif"><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument
(164,'240326000035-APPLE','ORGANISATION')">APPLE (45102)</a>]]></cell>
<cell><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument(164,'240326000035-APPLE'
,'ORGANISATION')">2403 260 00035</a>]]></cell>
		<cell><![CDATA[#008000_.2889]]></cell>
		<cell><![CDATA[#008000_.2889]]></cell>
		<cell><![CDATA[#008000_.2889]]></cell>
		<cell><![CDATA[#008000_.2825]]></cell>
		<cell><![CDATA[#5F5F5F_.2761]]></cell>
		<cell><![CDATA[#5F5F5F_.2697]]></cell>
		<cell><![CDATA[#5F5F5F_.2633]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[/docnum/images/greenball.gif]]></cell>
		<cell><![CDATA[<span style="color:#FF421E;">AMERICAS</span>]]></cell>
		<cell><![CDATA[<span style="color:#4181CE;">USA</span>]]></cell>
		<cell><![CDATA[EUROPE]]></cell>
	</row>
<row id="o2_p166" xmlkids="">
<cell image="spacer.gif"><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument
(166,'240326200049-APPLE','ORGANISATION')">APPLE (45102)</a>]]></cell>
<cell><![CDATA[<a style="text-decoration:none; color:black;" href="javascript:editPriceDocument(166,'240326200049-APPLE'
,'ORGANISATION')">2403 262 00049</a>]]></cell>
		<cell><![CDATA[#008000_.2825]]></cell>
		<cell><![CDATA[#008000_.2825]]></cell>
		<cell><![CDATA[#008000_.2825]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[]]></cell>
		<cell><![CDATA[/docnum/images/greenball.gif]]></cell>
		<cell><![CDATA[<span style="color:#FF421E;">AMERICAS</span>]]></cell>
		<cell><![CDATA[<span style="color:#4181CE;">USA</span>]]></cell>
		<cell><![CDATA[EUROPE]]></cell>
	</row>
</rows>

I am using a custom excell type to be able to show different colors in different columns.

Answer posted by Support on Jun 17, 2008 05:17
The sample with the same code (except of column type, because we have not code of rocustom excell ) works correctly with dhtmlxgrid 1.4 code
Sample has been sent by email.

If problem still occurs for you - please try to use js files from provided sample ( this is latest build of dhtmlxgrid 1.4 , which may differ from files used in your case )
Answer posted by Wolfgang Philipp on Jun 18, 2008 23:36
Thx, it is working now. Source Files were indeed not working correctly!
Answer posted by Wolfgang Philipp on Jun 19, 2008 00:16
But now there are some other problems which I did not have with former files. If there is a menu item opened in the tree and I want to sort by a special column the items from the tree (menu items) move to another position in the grid (another row) every time I click on the column. I tried to use older files again and it does not show a behaviour like that. What could be wrong?

Thx in advance!
Answer posted by Wolfgang Philipp on Jun 24, 2008 06:27
No idea for my previous question??

Is there any difference regarding custom sorting to take into account when you are using TreeGrid instead of Grid? When I click on a column to sort position of menu items are moving to other rows. But i think this is not usual behaviour because main items should stay in the row where they are and only sub-items in an open menu-item should change, right?


I have defined a custom excell type to be able to show different columns in different colors. Here is the source code:

function eXcell_rocustom(cell)
{
    try
    {
        this.cell = cell;
        this.grid = this.cell.parentNode.grid;
    }
    catch(er)
    {}
    this.edit = function()
    {
        return false;   
    }
    this.getValue = function()
    {
        return this.cell.innerHTML.toString();;
    }
    this.setValue = function(val)
    {
        if(val.toString()=="")
        {
            val = "&nbsp;";   
        }
        else
        {
            if (val.toString().indexOf("#") != -1)
            {
                color = val.toString().substr(0,7);
                val = val.toString().substring(val.indexOf("_")+1);
                if (val < 1)
                {
                    val = "0"+val;
                }
                val = parseFloat(val).toFixed(4);
                val = "<span style=\"color:"+color+";\">"+val+"</span>";
            }
            else
            {
                if (val < 1)
                {
                    val = "0"+val;
                }
            }
        }
        this.cell.innerHTML = val;
    }
    this.detach = function()
    {
        return false;
    }
}
eXcell_rocustom.prototype = new eXcell;

So most of the values (except empty ones) within the cells are:

<span style="color:#008000">0,4896</span>

custom sorting function is:

function sort_custom(a,b,order)
{
   
    if (a != "&nbsp;")
    {
        a = a.substring(a.indexOf(">")+1, a.lastIndexOf("<"));
    }
    if (b != "&nbsp;")
    {
        b = b.substring(b.indexOf(">")+1, b.lastIndexOf("<"));
    }
    if (order == "asc")
    {
        return a>b?1:-1;
    }
    else
    {
        return a<b?1:-1;
    }
}

What could be wrong? Thx in advance!
Answer posted by Support on Jun 24, 2008 08:47
>>Is there any difference regarding custom sorting to take into account when you are using TreeGrid instead of Grid?
Basically it works the same. The only difference is that stable sorting (grid.enableStableSorting) available for plain grids only

>>If there is a menu item opened in the tree and I want to sort by a special column the
>> items from the tree (menu items) move to another position in the grid (another row) every time I click on the column.
I checked the same code as in your case - and it works correctly for me in local samples. The hierarchy structure not corrupted. The items may shift their position inside the same parent ( this is caused by used sorting approach )

If problem still occurs for you  - please send any kind of sample where issue can be reconstructed to support@dhtmlx.com

Answer posted by Wolfgang Philipp on Jul 02, 2008 04:29
I dont know, it is still not working. Could it be that it does not work because the files you sent to me (newer version of 1.4) where in lower cases, but mine include capitals as well. For example the files you sent me look like dhtmlxcommon.js but within my application it is dhtmlXCommon.js. It doesnt work if i do not change the capitals in the file. But could it be that it does not work because i renamed the files?

Thx in advance!
Answer posted by Support on Jul 02, 2008 04:41
Started from dhtlmxgrid 1.5 all file names was lowercased.
The casing itself must not cause issue ( if it is incorrect, wile would not be loaded, and grid will not render at all ), renaming files is safe as well.
Answer posted by Wolfgang Philipp on Jul 02, 2008 06:28
I just tried to upgrade from Version 1.4 to Version 1.5. I started the application with 1.4 but because there are some source files not working correctly I wanted to upgrade. I was told that I only need to overwrite old files with the new ones from version 1.6. But when I do this and want to load treegrid it says: "dhtmlxHierarchy is not defined"

What could be wrong?
Answer posted by Wolfgang Philipp on Jul 02, 2008 09:19
Could you do me a favour again, please? Because custom sorting is not working with my source files could you please send me all necessary files which is concerned with the TreeGrid and custom sorting? And please files from latest release of version 1.4.

I am using the Professional Edition. If it doesnt work then, i give up!!
Answer posted by Support on Jul 08, 2008 02:42
Working samples of custom sorting with both dhtmlxgrid 1.4 and dhtmlxgrid 1.5 sent by email
The issue may be caused by old version of grid, but the js file, which was sent previously , must resolve issue.
Answer posted by Wolfgang Philipp on Jul 08, 2008 03:58
Didnt get a mail with a sample or do you mean the mail you sent me last time?

Well, the issue is solved with these files, at least for custom sorting. But now there is another problem. Whenever I want to sort by a column the items in the grid move to another position, not only the child items, but also the not opened items. This issue didnt occur when I used old version with which custom sorting was not possible so I assume this new issue has to do with new files too. Grid doesnt work if I keep the source files in lower cases, have to adapt it to old style. I just would like to have some working files,  we are paying for these files and  it seems they never work. Custom sorting didnt work at all, now it is working, but another problem arised.

Do I have to overwrite the CSS files from my applications with the files from your sample too? Or only the JS-Files? Do I have to use the codebase folder or just use the folder where the files are placed in at the moment?

I think my problems would be solved if I could upgrade within the existing application from Version 1.4 to 1.5. I was told here that I only have to overwrite existing files (1.4) with files from Version 1.5. But this is not working. It says: dhtmlXHierarchy is not defined. So how do I upgrade?
Answer posted by Support on Jul 09, 2008 03:38
>>Didnt get a mail with a sample or do you mean the mail you sent me last time?
I checked and it seems that they really still not sent. We still await the info about your reference number ( This number was sent to you with the download link to the purchased product right after purchase. )

>>I want to sort by a column the items in the grid move to another position, not only the child items, but also the not opened items
If items has the same value for sortin column they can change their position ( use sorting way - quicksort - is fast , but doesn't preserve previous order of items )

>>Do I have to overwrite the CSS files from my applications with the files from your sample too? Or only the JS-Files?
If you are using the same version of grid as in sample - the usage of dhtmlxtreegrid.js from it must be enough.
If you are using older version - all files, including css ones, need to be replaced

>>It says: dhtmlXHierarchy is not defined. So how do I upgrade?
You need to update both dhtmlxGrid and dhtmlxTreeGrid to the same version ( 1.5 in your case ). Mentioned error may occur if you are using different versions of Grid and TreeGrid in same time.
Answer posted by Wolfgang Philipp on Jul 09, 2008 23:54
Oh, sorry, forgot the reference number.

It is 107255055

Thx