fix: tweak how grid data translates to Vue template context
per wuttaweb changes
This commit is contained in:
parent
37f760959d
commit
c1a2c9cc70
|
@ -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,
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue