Add Grid.set_sort_defaults()
method
This commit is contained in:
parent
332fadd42e
commit
20bae8e54b
|
@ -123,6 +123,10 @@ class Grid(object):
|
||||||
def set_sorter(self, key, *args, **kwargs):
|
def set_sorter(self, key, *args, **kwargs):
|
||||||
self.sorters[key] = self.make_sorter(*args, **kwargs)
|
self.sorters[key] = self.make_sorter(*args, **kwargs)
|
||||||
|
|
||||||
|
def set_sort_defaults(self, sortkey, sortdir='asc'):
|
||||||
|
self.default_sortkey = sortkey
|
||||||
|
self.default_sortdir = sortdir
|
||||||
|
|
||||||
def set_filter(self, key, *args, **kwargs):
|
def set_filter(self, key, *args, **kwargs):
|
||||||
if len(args) == 1 and args[0] is None:
|
if len(args) == 1 and args[0] is None:
|
||||||
self.filters.pop(key, None)
|
self.filters.pop(key, None)
|
||||||
|
|
Loading…
Reference in a new issue