From b14e8daa1ae0ed3fc73c89cbcc002a3efda3a576 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 28 Jun 2019 15:47:52 -0500 Subject: [PATCH] Expose a way to embed "raw" data values within Buefy grid data for sake of custom front-end stuff --- tailbone/grids/core.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tailbone/grids/core.py b/tailbone/grids/core.py index 439e4ea9..8a3393c8 100644 --- a/tailbone/grids/core.py +++ b/tailbone/grids/core.py @@ -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