Add support for "is row checkable" in grids

i.e. when grid has checkboxes, some rows maybe shouldn't get one
This commit is contained in:
Lance Edgar 2022-12-20 19:14:54 -06:00
parent e427e50d67
commit 871ea84f96
3 changed files with 85 additions and 2 deletions

View file

@ -451,6 +451,7 @@ class MasterView(View):
'url': lambda obj: self.get_action_url('view', obj),
'checkboxes': checkboxes,
'checked': self.checked,
'checkable': self.checkbox,
'clicking_row_checks_box': self.clicking_row_checks_box,
'assume_local_times': self.has_local_times,
}
@ -2765,6 +2766,7 @@ class MasterView(View):
def get_effective_query(self, session=None, **kwargs):
return self.get_effective_data(session=session, **kwargs)
# TODO: should rename to checkable?
def checkbox(self, instance):
"""
Returns a boolean indicating whether ot not a checkbox should be