Commit 2e8cde45 authored by Ivan Tyagov's avatar Ivan Tyagov

Listbox can define default display list.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37313 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5aca0037
...@@ -397,6 +397,14 @@ class ListBoxWidget(Widget.Widget): ...@@ -397,6 +397,14 @@ class ListBoxWidget(Widget.Widget):
required=0) required=0)
property_names.append('display_style_list') property_names.append('display_style_list')
default_display_style = fields.StringField('default_display_style',
title="Default display style",
description=(
"A default display style for listbox rendering."),
default='table',
required=0)
property_names.append('default_display_style')
list_action = fields.StringField('list_action', list_action = fields.StringField('list_action',
title='List Action', title='List Action',
description=('The id of the object action' description=('The id of the object action'
...@@ -933,6 +941,14 @@ class ListBoxRenderer: ...@@ -933,6 +941,14 @@ class ListBoxRenderer:
getDisplayStyleList = lazyMethod(getDisplayStyleList) getDisplayStyleList = lazyMethod(getDisplayStyleList)
def getDefaultDisplayStyle(self):
"""Return the list of avaible display style. Make sure that the
titles are in unicode"""
default_display_style = self.field.get_value('default_display_style')
return default_display_style
getDefaultDisplayStyle = lazyMethod(getDefaultDisplayStyle)
def getSearchColumnIdSet(self): def getSearchColumnIdSet(self):
"""Return the set of the ids of the search columns. Fall back to the catalog schema, if not defined. """Return the set of the ids of the search columns. Fall back to the catalog schema, if not defined.
""" """
...@@ -2426,7 +2442,6 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine): ...@@ -2426,7 +2442,6 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
html = u'<a href="%s">%s</a>' % (url, html) html = u'<a href="%s">%s</a>' % (url, html)
html_list.append((html, original_value, error, editable_field, url)) html_list.append((html, original_value, error, editable_field, url))
return html_list return html_list
allow_class(ListBoxHTMLRendererLine) allow_class(ListBoxHTMLRendererLine)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment