From f6d65d9bc7b93c5831ba8962ff342d5638410865 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 30 Mar 2012 12:09:10 -0400 Subject: [PATCH] experiment 1 Signed-off-by: Bill Erickson --- .../web/js/dojo/openils/widget/FlattenerGrid.js | 33 ++++++++++++++-------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js b/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js index 939cdacd19..0eb310595c 100644 --- a/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js +++ b/Open-ILS/web/js/dojo/openils/widget/FlattenerGrid.js @@ -204,18 +204,6 @@ if (!dojo._hasResource["openils.widget.FlattenerGrid"]) { }, "startup": function() { - if (!this.store) { - this._setStore( /* this exact method chosen intentionally */ - new openils.FlattenerStore({ - "fmClass": this.fmClass, - "fmIdentifier": this.fmIdentifier, - "mapClause": (this.mapClause || - this._cleanMapForStore(this._generateMap())), - "baseSort": this.baseSort, - "defaultSort": this.defaultSort - }) - ); - } /* Save original query for further filtering later */ this._baseQuery = dojo.clone(this.query); @@ -224,10 +212,30 @@ if (!dojo._hasResource["openils.widget.FlattenerGrid"]) { this.columnPicker = new openils.widget.GridColumnPicker( null, this.columnPersistKey, this); + this.columnPicker.onLoad = dojo.hitch( + this, function(opts) { this._finishStartup(opts.sortFields) }); this.columnPicker.load(); } this.inherited(arguments); + }, + + "_finishStartup": function() { + + if (!this.store) { + this.setStore( /* this exact method chosen intentionally */ + new openils.FlattenerStore({ + "fmClass": this.fmClass, + "fmIdentifier": this.fmIdentifier, + "mapClause": (this.mapClause || + this._cleanMapForStore(this._generateMap())), + "baseSort": this.baseSort, + "defaultSort": this.defaultSort + }) + ); + } + + //this.inherited(arguments); this._startupGridHelperColumns(); @@ -247,6 +255,7 @@ if (!dojo._hasResource["openils.widget.FlattenerGrid"]) { this._setupLinks(); }, + "_setupLinks": function() { this.linkHolder = new dijit.layout.ContentPane(); dojo.place(this.linkHolder.domNode, this.domNode, "before"); -- 2.11.0