fix: tweak how grid data translates to Vue template context

per wuttaweb changes
This commit is contained in:
Lance Edgar 2024-08-23 14:14:03 -05:00
parent 37f760959d
commit c1a2c9cc70
2 changed files with 8 additions and 1 deletions

View file

@ -1403,6 +1403,10 @@ class Grid(WuttaGrid):
if hasattr(rowobj, 'uuid'):
return rowobj.uuid
def get_vue_context(self):
""" """
return self.get_table_data()
def get_vue_data(self):
""" """
table_data = self.get_table_data()
@ -1506,6 +1510,8 @@ class Grid(WuttaGrid):
results = {
'data': data,
'row_classes': status_map,
# TODO: deprecate / remove this
'row_status_map': status_map,
}

View file

@ -311,7 +311,8 @@
<script type="text/javascript">
let ${grid.vue_component}CurrentData = ${json.dumps(grid.get_vue_data())|n}
const ${grid.vue_component}Context = ${json.dumps(grid.get_vue_context())|n}
let ${grid.vue_component}CurrentData = ${grid.vue_component}Context.data
let ${grid.vue_component}Data = {
loading: false,