Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Eric W. Bachtal on Feb 12, 2009 17:59
open dhtmlx forum
dhtmlxGrid (pro build 81009/81107) splitAt setSortImgState issue

Setting splitAt(>0) and clicking a non-frozen column header sorts and shows the (asc) sorted image. If previous to this one of the frozen columns had been clicked/sorted, this action properly clears the sorted image from it. However, if after clicking/sorting a non-frozen column you click back on a frozen column header, it will sort and show the sorted image there but it will *not* clear the sorted image from the previously sorted non-frozen column. Hope that makes sense.

Anyhow, to overcome this I modified the function attached to the onAfterSorting event in dhtmlxgrid_splt.js to include an else clause on the check for whether i (the column index) is >= ind (the number of frozen columns). This else clause clears the sorted image from the frozen column. So, instead of this:

this.attachEvent("onAfterSorting",function(i,b,c){
if (i>=ind)
this._fake.setSortImgState(false)
})    

It now reads:

this.attachEvent("onAfterSorting",function(i,b,c){
if (i>=ind)
this._fake.setSortImgState(false);
else
this.setSortImgState(false);
})

This will probably suffice for us for now, but I would like to hear your thoughts.

Thanks in advance.
Answer posted by Support on Feb 13, 2009 10:18
Issue already fixed in latest dev. version, fix will be released as part of oncoming update. Please contact us directly at support@dhtmlx.com if you need an update ASAP
The solution which you have provided use different approach, but seems stable enough, and must not cause any side effects.