Opened 13 years ago

Last modified 12 years ago

#2739 closed enhancement

FilteringTable.columns[i].sortFunction - KISS, one-liner — at Version 2

Reported by: guest Owned by: Tom Trenka
Priority: high Milestone:
Component: Widgets Version: 0.4.2
Keywords: FilteringTable sortFunction sortusing Cc:
Blocked By: Blocking:

Description (last modified by Adam Peller)

[ Dojo 0.4.2 ] I can deal with an dojoAddOnLoad like this:

var filteringTable     = dojo.widget.byId ('filteringTableId');
var myKradSortFunction = function (a, b, direction) { ... }
filteringTable.columns[0].sortFunction = myKradSortFunction;

It is not as elegant is it should be, but it is straight-forward. I really shouldn't have to walk into your house and raid the fridge when I want to borrow a cup of milk... For another day...

This allows me to build the FilteringTable? from markup, which vastly simplifies my life. CSS headaches, etc...

So if everyone else insists on making things more complicated then they {need to/should} be, here's a patch for the little guy.

--- FilteringTable.js.original  2007-04-13 13:09:44.000000000 -0400
+++ FilteringTable.js   2007-04-13 13:09:54.000000000 -0400
@@ -427,6 +427,7 @@
                        var a =, field);
                        var b =, field);
+                       if (meta.sortFunction && typeof meta.sortFunction == 'function') { return meta.sortFunction (a, b, dir); } /* PATCH */
                        var ret = 0;
                        if (a > b) {
                                ret = 1;

Change History (3)

Changed 13 years ago by guest

Attachment: FilteringTable.js.patch added

comment:1 Changed 13 years ago by alex

Milestone: 0.9M20.4.3

comment:2 Changed 13 years ago by Adam Peller

Description: modified (diff)
Owner: changed from bill to Tom Trenka

Who submitted this? Is there a CLA?

Note: See TracTickets for help on using tickets.