Handle sort attribute on Selection field
This commit is contained in:
1 parent
f100fda9a1
commit
a03d6dd19b
2 files changed
+4
-2
No files matched your search
@@ -46,7 +46,8 @@ class Selection(WidgetInterface):
|
||||
except Exception, exception:
|
||||
common.process_exception(exception, self._window)
|
||||
selection = []
|
||||
selection.sort(lambda x, y: cmp(x[1], y[1]))
|
||||
if attrs.get('sort', True):
|
||||
selection.sort(lambda x, y: cmp(x[1], y[1]))
|
||||
attrs['selection'] = selection
|
||||
self.set_popdown(selection)
|
||||
self.last_key = (None, 0)
|
||||
|
||||
@@ -628,7 +628,8 @@ class Selection(Char):
|
||||
except Exception, exception:
|
||||
common.process_exception(exception, self.window)
|
||||
selection = []
|
||||
selection.sort(lambda x, y: cmp(x[1], y[1]))
|
||||
if self.attrs.get('sort', True):
|
||||
selection.sort(lambda x, y: cmp(x[1], y[1]))
|
||||
self.attrs['selection'] = selection
|
||||
self.selection = selection
|
||||
for i in self.selection:
|
||||
|
||||
Reference in new issue
Block a user