From e5a6d5fecedc9d404b749e371c9521b872f7c2a8 Mon Sep 17 00:00:00 2001
From: Renaud Le Gac <legac@cppm.in2p3.fr>
Date: Fri, 20 Feb 2015 10:09:22 +0100
Subject: [PATCH] Fix issue in the viewport tab identifier, by using node path.

---
 static/plugin_dbui/src/container/Viewport.js | 6 +++---
 views/plugin_dbui/versions.html              | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/static/plugin_dbui/src/container/Viewport.js b/static/plugin_dbui/src/container/Viewport.js
index d93f1d9e..7b546bcd 100644
--- a/static/plugin_dbui/src/container/Viewport.js
+++ b/static/plugin_dbui/src/container/Viewport.js
@@ -203,7 +203,7 @@ Ext.define('App.container.Viewport', {
             window;
 
         // protection
-        if (!record.isNode) {
+        if (!record.isNode  || !item) {
             return;
         }
 
@@ -232,8 +232,8 @@ Ext.define('App.container.Viewport', {
             return;
         }
 
-        // unique tab identifier
-        tabId = record.get('text') + '/' + wdgtype;
+        // unique tab identifier based on the node path
+        tabId = record.getPath('text', '_');
 
         // activate an existing tab
         if (this.tabPanel.getComponent(tabId)) {
diff --git a/views/plugin_dbui/versions.html b/views/plugin_dbui/versions.html
index da008a1e..e4fc6fad 100644
--- a/views/plugin_dbui/versions.html
+++ b/views/plugin_dbui/versions.html
@@ -41,14 +41,14 @@
         plugins: ['pGridExport'],
         store: cfgStore,
         columns: [
-            {text: "Software", dataIndex: 'code', flex: 0.8},
-            {text: "Version", dataIndex: 'version', flex: 1.2}
+            {text: "Software", dataIndex: 'code'},
+            {text: "Version", dataIndex: 'version'}
         ],
         forceFit: true,
         hideHeaders: true,
         padding: "10 40 20 60",
         renderTo: divgrid,
-        width: 300
+        width: 400
     });
 
 </script>
-- 
GitLab