Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#2739 closed enhancement (wontfix)

FilteringTable.columns[i].sortFunction - KISS, one-liner

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 = self.store.getField(self.getDataByRow(rowA), field);
                        var b = self.store.getField(self.getDataByRow(rowB), field);
+                       if (meta.sortFunction && typeof meta.sortFunction == 'function') { return meta.sortFunction (a, b, dir); } /* PATCH */
                        var ret = 0;
                        if (a > b) {
                                ret = 1;

Attachments (1)

FilteringTable.js.patch (602 bytes) - added by guest 12 years ago.

Download all attachments as: .zip

Change History (6)

Changed 12 years ago by guest

Attachment: FilteringTable.js.patch added

comment:1 Changed 12 years ago by alex

Milestone: 0.9M20.4.3

comment:2 Changed 12 years ago by Adam Peller

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

Who submitted this? Is there a CLA?

comment:3 Changed 12 years ago by Adam Peller

I guess this falls under the category of "trivial"

comment:4 Changed 12 years ago by Tom Trenka

Resolution: wontfix
Status: newclosed

More like invalid, because I'm not going to add the ability to pass in a direction; that's already taken care of by the createSorter method's execution.

comment:5 Changed 11 years ago by (none)

Milestone: 0.4.4

Milestone 0.4.4 deleted

Note: See TracTickets for help on using tickets.