From 2ec69f45fb76e91cbe0fb8494a7b8da64af81a7e Mon Sep 17 00:00:00 2001 From: senator Date: Fri, 10 Sep 2010 22:02:18 +0000 Subject: [PATCH] Make it a little more straightfoward to refresh an autogrid from without. Can be useful in making glitchy, half-rendered grids behave. git-svn-id: svn://svn.open-ils.org/ILS/trunk@17597 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/dojo/openils/widget/AutoGrid.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js index 923c9b446..4495e1cf5 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js @@ -87,14 +87,10 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { style : 'padding-right:6px;', href : 'javascript:void(0);', onclick : function() { - self.resetStore(); self.cachedQueryOpts.offset = self.displayOffset -= self.displayLimit; if(self.displayOffset < 0) self.cachedQueryOpts.offset = self.displayOffset = 0; - if(self.dataLoader) - self.dataLoader() - else - self.loadAll(self.cachedQueryOpts, self.cachedQuerySearch); + self.refresh(); } }); @@ -103,12 +99,8 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { style : 'padding-right:6px;', href : 'javascript:void(0);', onclick : function() { - self.resetStore(); self.cachedQueryOpts.offset = self.displayOffset += self.displayLimit; - if(self.dataLoader) - self.dataLoader() - else - self.loadAll(self.cachedQueryOpts, self.cachedQuerySearch); + self.refresh(); } }); @@ -557,6 +549,14 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { this.setStore(this.buildAutoStore()); }, + refresh : function() { + this.resetStore(); + if (this.dataLoader) + this.dataLoader() + else + this.loadAll(this.cachedQueryOpts, this.cachedQuerySearch); + }, + loadAll : function(opts, search) { dojo.require('openils.PermaCrud'); if(this.loadProgressIndicator) -- 2.11.0