Add filter support for mobile row grid; plus mark receiving as complete
This commit is contained in:
parent
f47157102c
commit
98ff71a2dd
7 changed files with 96 additions and 33 deletions
|
@ -96,6 +96,7 @@ class MasterView(View):
|
|||
rows_bulk_deletable = False
|
||||
rows_default_pagesize = 20
|
||||
|
||||
mobile_rows_filterable = False
|
||||
mobile_rows_viewable = False
|
||||
|
||||
@property
|
||||
|
@ -206,11 +207,32 @@ class MasterView(View):
|
|||
defaults.update(kwargs)
|
||||
return defaults
|
||||
|
||||
def make_mobile_row_grid_kwargs(self, **kwargs):
|
||||
"""
|
||||
Must return a dictionary of kwargs to be passed to the factory when
|
||||
creating new mobile *row* grid instances.
|
||||
"""
|
||||
defaults = {
|
||||
'route_prefix': self.get_route_prefix(),
|
||||
'pageable': self.pageable,
|
||||
'sortable': False,
|
||||
'filterable': self.mobile_rows_filterable,
|
||||
}
|
||||
if self.mobile_rows_filterable:
|
||||
defaults['filters'] = self.make_mobile_row_filters()
|
||||
defaults.update(kwargs)
|
||||
return defaults
|
||||
|
||||
def make_mobile_filters(self):
|
||||
"""
|
||||
Returns a set of filters for the mobile grid, if applicable.
|
||||
"""
|
||||
|
||||
def make_mobile_row_filters(self):
|
||||
"""
|
||||
Returns a set of filters for the mobile row grid, if applicable.
|
||||
"""
|
||||
|
||||
def preconfigure_mobile_grid(self, grid):
|
||||
"""
|
||||
Optionally perform pre-configuration for the mobile grid, to establish
|
||||
|
@ -588,14 +610,6 @@ class MasterView(View):
|
|||
def get_mobile_row_data(self, parent):
|
||||
return self.get_row_data(parent)
|
||||
|
||||
def make_mobile_row_grid_kwargs(self, **kwargs):
|
||||
defaults = {
|
||||
'pageable': True,
|
||||
'sortable': True,
|
||||
}
|
||||
defaults.update(kwargs)
|
||||
return defaults
|
||||
|
||||
def make_mobile_row_grid(self, **kwargs):
|
||||
"""
|
||||
Make a new (configured) rows grid instance for mobile.
|
||||
|
@ -607,7 +621,7 @@ class MasterView(View):
|
|||
kwargs.setdefault('request', self.request)
|
||||
kwargs.setdefault('model_class', self.model_row_class)
|
||||
kwargs = self.make_mobile_row_grid_kwargs(**kwargs)
|
||||
factory = self.get_grid_factory()
|
||||
factory = self.get_mobile_grid_factory()
|
||||
grid = factory(**kwargs)
|
||||
self.configure_mobile_row_grid(grid)
|
||||
grid.load_settings()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue