Add remove_sorter()
method for grids
This commit is contained in:
parent
3d6cc8a490
commit
abca0115a6
|
@ -353,7 +353,13 @@ class Grid(object):
|
|||
self.joiners[key] = joiner
|
||||
|
||||
def set_sorter(self, key, *args, **kwargs):
|
||||
self.sorters[key] = self.make_sorter(*args, **kwargs)
|
||||
if len(args) == 1 and args[0] is None:
|
||||
self.remove_sorter(key)
|
||||
else:
|
||||
self.sorters[key] = self.make_sorter(*args, **kwargs)
|
||||
|
||||
def remove_sorter(self, key):
|
||||
self.sorters.pop(key, None)
|
||||
|
||||
def set_sort_defaults(self, sortkey, sortdir='asc'):
|
||||
self.default_sortkey = sortkey
|
||||
|
|
Loading…
Reference in a new issue