-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
column sortable option must fallback to True #216
Comments
Should it fall back to True or False? It was off by default in List because back when vanilla used Cocoa Bindings sorting was quite difficult and in some instances would modify the represented data. I don't know if we should preserve the off-by-default setting or not. |
thanks for looking into it. it would be nice if it could behave just like import ezui
import vanilla
myTableItems = [
dict(name="A", value=8),
dict(name="X", value=9),
dict(name="B", value=2),
dict(name="D", value=7),
dict(name="Z", value=3),
]
class DemoTable(ezui.WindowController):
def build(self):
content = """
|------|-------|
| name | value | @myTable
|------|-------|
"""
descriptionData = dict(
myTable=dict(
items=myTableItems,
allowsSorting=True,
columnDescriptions=[
dict(
identifier="name",
title="name",
),
dict(
identifier="value",
title="value",
),
],
),
)
self.w = ezui.EZWindow(
title="ezui Table",
size=(300, 200),
content=content,
descriptionData=descriptionData,
controller=self
)
def started(self):
self.w.open()
class DemoList2:
def __init__(self):
self.w = vanilla.Window((300, 200), title='vanilla List2')
self.w.list = vanilla.List2(
(10, 10, -10, -10),
items=myTableItems,
allowsSorting=True,
columnDescriptions=[
dict(
identifier="name",
title="name",
),
dict(
identifier="value",
title="value",
),
],
)
self.w.open()
class DemoList:
def __init__(self):
self.w = vanilla.Window((300, 200), title='vanilla List')
self.w.list = vanilla.List(
(10, 10, -10, -10),
myTableItems,
allowsSorting=True,
columnDescriptions=[
dict(
identifier="name",
title="name",
),
dict(
identifier="value",
title="value",
),
],
)
self.w.open()
DemoTable()
DemoList2()
DemoList() |
the documentation mentioned the fallback should be vanilla/Lib/vanilla/vanillaList2.py Lines 397 to 400 in 3ef4eba
A vanillaList2 has support to disable specific columns not to be sorted even if the global |
Was there any update on this? There are some EZUI-based tools that I think would be greatly enhanced with the ability to sort table results. Thanks! |
vanilla/Lib/vanilla/vanillaList2.py
Line 656 in 3ef4eba
now it falls back to
None
The text was updated successfully, but these errors were encountered: