Skip to content

Commit 1cf87ca

Browse files
committed
add: option to specify datatable kwargs for browseview
1 parent b4ef099 commit 1cf87ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

basxbread/views/browse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class BrowseView(BaseView, LoginRequiredMixin, PermissionRequiredMixin, ListView
114114
itemsperpage_urlparameter: str = "itemsperpage"
115115
search_urlparameter: str = "q"
116116

117-
title: Union[hg.BaseElement, str] = ""
117+
title: Union[hg.BaseElement, str] = None
118118
columns: Iterable[Union[str, layout.datatable.DataTableColumn]] = ("__all__",)
119119
rowclickaction: Optional[Link] = None
120120
filterconfig: Optional[tuple] = None
@@ -191,7 +191,7 @@ def __init__(self, *args, **kwargs):
191191
or default_bulkactions(self.model, self.columns)
192192
)
193193

194-
def get_layout(self, **datatable_kwargs):
194+
def get_layout(self):
195195
# re-mapping the Links because the URL is not supposed to be a real URL but an identifier
196196
# for the bulk action
197197
# TODO: This is a bit ugly but we can reuse the Link type for icon, label and permissions
@@ -240,7 +240,7 @@ def get_layout(self, **datatable_kwargs):
240240
backurl=self.backurl,
241241
primary_button=self.primary_button,
242242
search_urlparameter=self.search_urlparameter,
243-
**datatable_kwargs,
243+
**getattr(self, "datatable_kwargs", {}),
244244
)
245245

246246
def get_context_data(self, *args, **kwargs):

0 commit comments

Comments
 (0)