Expose a way to embed "raw" data values within Buefy grid data

for sake of custom front-end stuff
This commit is contained in:
Lance Edgar 2019-06-28 15:47:52 -05:00
parent 3a53ffcc23
commit b14e8daa1a

View file

@ -1124,8 +1124,17 @@ class Grid(object):
rowobj = raw_data[i]
row = {}
# sometimes we need to include some "raw" data columns in our
# result set, even though the column is not displayed as part of
# the grid. this can be used for front-end editing of row data for
# instance, when the "display" version is different than raw data.
# here is the hack we use for that.
columns = list(self.columns)
if hasattr(self, 'buefy_data_columns'):
columns.extend(self.buefy_data_columns)
# iterate over data fields
for name in self.columns:
for name in columns:
# leverage configured rendering logic where applicable;
# otherwise use "raw" data value as string