[ 3 posts ]

Andy Coates

  • Username: apc105
  • Joined: Fri Nov 06, 2009 9:43 am
  • Posts: 2
  • Offline
  • Profile

RowExpansion prevents reverse sorting & highlighting

Post Posted: Fri Nov 06, 2009 10:10 am
+0-
I've combined a standard, local datasource datatable that has multiple sortable columns with the expandable row function. The resulting datatable object allows the rows to be expanded correctly, however there are two issues:

1. clicking on the column headers does sort the table correctly in ascending order, but clicking once more has no effect, i.e. it does not reverse sort the same column
2. the sort highlighting is not applied when sorting a column nor does the sorted icon appear in the column heading.

I've experimented by removing parts of the additional code that provides the row expand functions and it seems to be the initAttributes function that is somehow causing the problems.
Removing the override function fixes the sorting issues [but of course removes the expandable row functionality] and leaving only the superclass call prevents both the row expansion and the sorting/highlighting from working.

Code:
            initAttributes : function( oConfigs ) {
                                oConfigs = oConfigs || {};
                                YAHOO.widget.DataTable.superclass.initAttributes.call( this, oConfigs );
                                        this.setAttributeConfig("rowExpansionTemplate", {
                                                        value: "",
                                                        validator: function( template ){
                                                return (
                                                        YAHOO.lang.isString( template ) ||
                                                        YAHOO.lang.isFunction( template )
                                                );
                                        },
                                        method: this.initRowExpansion
                                        });
                        },


Has anyone seen this problem or have any suggestions on how to resolve it?

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile

Re: RowExpansion prevents reverse sorting & highlighting

Post Posted: Fri Nov 06, 2009 10:24 am
+0-
The problem with the example has been reported:

http://yuilibrary.com/projects/yui2/ticket/2528595

Christian Tiberg has provided a better version of that example:

http://gist.github.com/225100

Andy Coates

  • Username: apc105
  • Joined: Fri Nov 06, 2009 9:43 am
  • Posts: 2
  • Offline
  • Profile

Re: RowExpansion prevents reverse sorting & highlighting

Post Posted: Fri Nov 06, 2009 5:04 pm
+0-
Thank you. That looks to be exactly the problem I've been facing. I'll give the suggested changes a try and let you know if I run into any problems.
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum