Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by DM on Nov 01, 2009 11:41
open dhtmlx forum
Date sorting seems to be not working with filter option..

Hi..

We are using the following code to specify the display format for a date column of DTML grid.

<td type="dhxCalendar" format="%m/%d/%Y" sort="date" align="center">

var mygrid = new dhtmlXGridFromTable("pressRoomGridBox");
            mygrid.setEditable(false);
            mygrid.enableAutoHeight(true);
            mygrid.enableResizing("false,false");
            mygrid.setInitWidthsP("20,80");
             mygrid.sortRows(0,"date","desc");
            mygrid.setSortImgState(true, 0, "desc", 1);
            mygrid.attachEvent("onMouseOver",function(ind){
                return false;
            });

With the above code sorting works perfectly fine for date column. But, We also need to use filter by option on some other attribute (column) for this grid. With filter by option, the sorting for date column stops working..For other attribute we have already overrided the defaut sorting. Only for this date column, we are relying on default sort method "date"..

<xsl:when test="$type = ''decimal''">                                    <td align="{$align}" width="{$width}" sort="sortDecimalValues">                        <xsl:value-of select="$root/bodycontent/table/metadata/columns/column[$headerColumnIndex]/label" disable-output-escaping="yes"/>                            </td>
                                        </xsl:when>                                    <xsl:otherwise>                                    <td align="{$align}" width="{$width}" sort="sortHyperLinks">                        <xsl:value-of select="$root/bodycontent/table/metadata/columns/column[$headerColumnIndex]/label" disable-output-escaping="yes"/>                            </td>                                </xsl:otherwise>
Kindly suggest How can we use default sort methods (date etc.), if we have already specified filtering on the grid....
Answer posted by dhxSupport on Nov 02, 2009 03:32
Unfortunately we cannot reproduce this issue locally. Can you please provide complete demo where we can reproduce it? (Please send such example directly to the support@dhtmlx.com)