From: <Se...@us...> - 2012-08-22 03:30:48
|
Revision: 6315 http://jaffa.svn.sourceforge.net/jaffa/?rev=6315&view=rev Author: SeanZ Date: 2012-08-22 03:30:41 +0000 (Wed, 22 Aug 2012) Log Message: ----------- Added addResultsPanel() and removeResultsPanel(). Modified Paths: -------------- trunk/JaffaRIA/source/html/js/extjs/jaffa/finder/MultiResultsFinderContainer.js Modified: trunk/JaffaRIA/source/html/js/extjs/jaffa/finder/MultiResultsFinderContainer.js =================================================================== --- trunk/JaffaRIA/source/html/js/extjs/jaffa/finder/MultiResultsFinderContainer.js 2012-08-21 23:16:56 UTC (rev 6314) +++ trunk/JaffaRIA/source/html/js/extjs/jaffa/finder/MultiResultsFinderContainer.js 2012-08-22 03:30:41 UTC (rev 6315) @@ -1,5 +1,7 @@ /** - * A finderContainer without card/slide layout + * A finderContainer that houses multiple results tabs. + * The data loading of each tab could come from a store or a controller. + * Important: Assumes no sharing of store nor controller. * * @author Sean Zhou, Jan. 2012 * @@ -123,5 +125,44 @@ } } } + + ,addResultsPanel: function(panel) { + var newPanel = false; + if (panel.controller && panel.controller.id) { + for (var i=0; i<this.criteriaPanel.controllers.length; i++) { + if (panel.controller.id == this.criteriaPanel.controllers[i].id) return; + } + this.criteriaPanel.controllers.push(panel.controller); + newPanel = true; + } else if (panel.store && panel.store.id) { + for (var i=0; ithis.criteriaPanel.stores.length; i++) { + if (panel.store.id == this.criteriaPanel.stores[i].id) return; + } + this.criteriaPanel.stores.push(panel.store); + newPanel = true; + } else if (!panel.store && !panel.controller) { + newPanel = true; + } + if (newPanel) this.resultsPanel.add(panel); + } + + ,removeResultsPanel: function(panel) { + if (panel.controller) { + for (var i=0; i<this.criteriaPanel.controllers.length; i++) { + if (panel.controller == this.controllers[i]) { + this.criteriaPanel.controllers.splice(i,1); + break; + } + } + } else if (panel.store) { + for (var i=0; i<this.criteriaPanel.stores.length; i++) { + if (panel.store == this.criteriaPanel.stores[i]) { + this.criteriaPanel.stores.splice(i,1); + break; + } + } + } + this.resultsPanel.remove(panel); + } }); -Ext.reg('multiresultsfindercontainer', Jaffa.finder.MultiResultsFinderContainer) +Ext.reg('multiresultsfindercontainer', Jaffa.finder.MultiResultsFinderContainer); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |