]> git.proxmox.com Git - pve-manager.git/commitdiff
move chart series initialization into initComponent
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 6 Dec 2016 15:26:38 +0000 (16:26 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 19 Dec 2016 11:03:07 +0000 (12:03 +0100)
with extjs 6.2 the charts are initialized differently, so that we can
not do this in the afterrender event, instead we do it in the
initComponent, after calling callParent

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/panel/RRDChart.js

index 5b2abf189a9082682d2aaff9b0756d96199b7f9e..4cb6dcda6ad13e88441c01a6ae2f718f8ab4836b 100644 (file)
@@ -25,7 +25,6 @@ Ext.define('PVE.widget.RRDChart', {
        docked: 'bottom'
     },
     listeners: {
-       afterrender: 'onAfterRender',
        animationend: 'onAfterAnimation'
     },
 
@@ -96,9 +95,27 @@ Ext.define('PVE.widget.RRDChart', {
            '<br>' + new Date(record.get('time')));
     },
 
-    onAfterRender: function(){
+    onAfterAnimation: function(chart, eopts) {
+       // if the undobuton is disabled,
+       // disable our tool
+       var ourUndoZoomButton = chart.tools[0];
+       var undoButton = chart.interactions[0].getUndoButton();
+       ourUndoZoomButton.setDisabled(undoButton.isDisabled());
+    },
+
+    initComponent: function() {
        var me = this;
 
+       if (!me.store) {
+           throw "cannot work without store";
+       }
+
+       if (!me.fields) {
+           throw "cannot work without fields";
+       }
+
+       me.callParent();
+
        // add correct label for left axis
        var axisTitle = "";
        if (me.percentArr.indexOf(me.fields[0]) != -1) {
@@ -161,28 +178,6 @@ Ext.define('PVE.widget.RRDChart', {
                }
            });
        });
-    },
-
-    onAfterAnimation: function(chart, eopts) {
-       // if the undobuton is disabled,
-       // disable our tool
-       var ourUndoZoomButton = chart.tools[0];
-       var undoButton = chart.interactions[0].getUndoButton();
-       ourUndoZoomButton.setDisabled(undoButton.isDisabled());
-    },
-
-    initComponent: function() {
-       var me = this;
-
-       if (!me.store) {
-           throw "cannot work without store";
-       }
-
-       if (!me.fields) {
-           throw "cannot work without fields";
-       }
-
-       me.callParent();
 
        // enable animation after the store is loaded
        me.store.onAfter('load', function() {