From 10fbba1ea4a8c9446abc45bfc8037a02ddb9fabe Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 2 Apr 2012 10:19:02 -0400 Subject: [PATCH] FlattenerGrid (re)honors IDL column labels as default Linking the GridColumnPicker to FlattenerGrid killed the ability for the FlattenerGrid to fall back to the IDL column label when no label was defined in the markup. This change adds a reloadStructure operation to GridColumnPicker. FlattenerGrid uses this to pass the updated column labels (and any other changes) to gridcolumnpicker, which then updates the grid display to match. Signed-off-by: Bill Erickson Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Mike Rylander --- Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js | 3 +++ .../web/js/dojo/openils/widget/GridColumnPicker.js | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js b/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js index b3ea3f1a45..a18cd4aba4 100644 --- a/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js +++ b/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js @@ -298,6 +298,9 @@ if (!dojo._hasResource["openils.widget.FlattenerGrid"]) { }), this.query ); + // pick up any column label changes + this.columnPicker.reloadStructure(); + this._showing_create_pane = false; this.overrideEditWidgets = {}; diff --git a/Open-ILS/web/js/dojo/openils/widget/GridColumnPicker.js b/Open-ILS/web/js/dojo/openils/widget/GridColumnPicker.js index 250bca5349..9cc367d8f4 100644 --- a/Open-ILS/web/js/dojo/openils/widget/GridColumnPicker.js +++ b/Open-ILS/web/js/dojo/openils/widget/GridColumnPicker.js @@ -58,6 +58,16 @@ if(!dojo._hasResource["openils.widget.GridColumnPicker"]) { }; }, + /** Loads the current grid structure and passes the + * structure back to the grid to force a UI refresh. + * This is necessary if external forces alter the structure. + */ + reloadStructure : function() { + this.structure = this.grid.structure; + this.cells = this.structure[0].cells[0].slice(); + this.grid.setStructure(this.structure); + }, + // determine the visible sorting from the // view and update our list of cells to match refreshCells : function() { -- 2.43.2