Add basic autocomplete support for "quick row" feature
This commit is contained in:
parent
68bd3047c4
commit
935a6b2a68
4 changed files with 58 additions and 7 deletions
|
@ -1790,6 +1790,18 @@ class MasterView(View):
|
|||
context['row_model_title_plural'] = self.get_row_model_title_plural()
|
||||
context['row_action_url'] = self.get_row_action_url
|
||||
|
||||
if mobile:
|
||||
|
||||
if self.mobile_rows_creatable:
|
||||
context['add_item_title'] = "Add Record"
|
||||
|
||||
if self.mobile_rows_quickable:
|
||||
context['quick_row_entry_placeholder'] = "Enter search text"
|
||||
|
||||
# quick row does *not* use autocomplete by default
|
||||
context['quick_row_autocomplete'] = False
|
||||
context['quick_row_autocomplete_url'] = '#'
|
||||
|
||||
context.update(data)
|
||||
context.update(self.template_kwargs(**context))
|
||||
if hasattr(self, 'template_kwargs_{}'.format(template)):
|
||||
|
@ -2552,6 +2564,13 @@ class MasterView(View):
|
|||
"""
|
||||
return True
|
||||
|
||||
def rows_quickable_for(self, instance):
|
||||
"""
|
||||
Must return boolean indicating whether the "quick row" feature should
|
||||
be allowed for the given instance. Returns ``True`` by default.
|
||||
"""
|
||||
return True
|
||||
|
||||
def row_editable(self, row):
|
||||
"""
|
||||
Returns boolean indicating whether or not the given row can be
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue