make appstarter grid usable in situations w.o. default mainscreen
authorCornelius Weiß <c.weiss@metaways.de>
Sat, 15 Jul 2017 11:35:09 +0000 (13:35 +0200)
committerCornelius Weiss <c.weiss@metaways.de>
Sat, 15 Jul 2017 11:33:25 +0000 (13:33 +0200)
Change-Id: I1f6f133fbdf175149c87facc1f30c0a1231afcc9
Reviewed-on: http://gerrit.tine20.com/customers/5192
Reviewed-by: Cornelius Weiss <c.weiss@metaways.de>
Tested-by: Cornelius Weiss <c.weiss@metaways.de>
tine20/Tinebase/js/widgets/grid/GridPanel.js

index eb876a5..2e8f4fb 100644 (file)
@@ -1271,10 +1271,16 @@ Ext.extend(Tine.widgets.grid.GridPanel, Ext.Panel, {
      * perform the initial load of grid data
      */
     initialLoad: function() {
-        var defaultFavorite = Tine.widgets.persistentfilter.model.PersistentFilter.getDefaultFavorite(this.app.appName, this.recordClass.prototype.modelName);
-        var favoritesPanel  = this.app.getMainScreen() && typeof this.app.getMainScreen().getWestPanel().getFavoritesPanel === 'function' && this.hasFavoritesPanel 
-            ? this.app.getMainScreen().getWestPanel().getFavoritesPanel() 
-            : null;
+        var defaultFavorite = Tine.widgets.persistentfilter.model.PersistentFilter.getDefaultFavorite(
+                this.app.appName, this.recordClass.prototype.modelName
+            ),
+            favoritesPanel  = this.app.getMainScreen()
+            && typeof this.app.getMainScreen().getWestPanel === 'function'
+            && typeof this.app.getMainScreen().getWestPanel().getFavoritesPanel === 'function'
+            && this.hasFavoritesPanel
+                ? this.app.getMainScreen().getWestPanel().getFavoritesPanel()
+                : null;
+
         if (defaultFavorite && favoritesPanel) {
             favoritesPanel.selectFilter(defaultFavorite);
         } else {