diff --git a/web/pgadmin/browser/templates/browser/js/node.js b/web/pgadmin/browser/templates/browser/js/node.js index efe6413dd..955ad950a 100644 --- a/web/pgadmin/browser/templates/browser/js/node.js +++ b/web/pgadmin/browser/templates/browser/js/node.js @@ -1034,6 +1034,24 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) { cache: false, success: function() { onSaveFunc.call(); + // Removing the node-prop property of panel + // so that we show updated data on panel + var pnlProperties = pgBrowser.docker.findPanels('properties')[0], + pnlSql = pgBrowser.docker.findPanels('sql')[0], + pnlStats = pgBrowser.docker.findPanels('statistics')[0], + pnlDependencies = pgBrowser.docker.findPanels('dependencies')[0], + pnlDependents = pgBrowser.docker.findPanels('dependents')[0]; + + if(pnlProperties) + $(pnlProperties).removeData('node-prop'); + if(pnlSql) + $(pnlSql).removeData('node-prop'); + if(pnlStats) + $(pnlStats).removeData('node-prop'); + if(pnlDependencies) + $(pnlDependencies).removeData('node-prop'); + if(pnlDependents) + $(pnlDependents).removeData('node-prop'); }, error: function(m, jqxhr) { Alertify.pgNotifier( diff --git a/web/pgadmin/misc/depends/static/js/depends.js b/web/pgadmin/misc/depends/static/js/depends.js index 6883aa3cc..3acd30964 100644 --- a/web/pgadmin/misc/depends/static/js/depends.js +++ b/web/pgadmin/misc/depends/static/js/depends.js @@ -185,20 +185,12 @@ define( n_type = type; // Avoid unnecessary reloads - if (_.isUndefined(treeHierarchy[n_type]) || - _.isUndefined(treeHierarchy[n_type]._id)) { - n_value = -1; - } else { - n_value = treeHierarchy[n_type]._id; - } - - if (n_value == $(panel[0]).data(n_type)) { + if (_.isEqual($(panel[0]).data('node-prop'), treeHierarchy)) { return; } // Cache the current IDs for next time - $(panel[0]).data(n_type, n_value); - + $(panel[0]).data('node-prop', treeHierarchy); // Hide the grid container and show the default message container if (!$gridContainer.hasClass('hidden')) diff --git a/web/pgadmin/misc/sql/static/js/sql.js b/web/pgadmin/misc/sql/static/js/sql.js index 9c06c656a..a6db15016 100644 --- a/web/pgadmin/misc/sql/static/js/sql.js +++ b/web/pgadmin/misc/sql/static/js/sql.js @@ -59,28 +59,20 @@ function(_, $, pgBrowser) { var sql = ''; if (node) { sql = '-- ' + pgBrowser.messages.NODE_HAS_NO_SQL; + var self = this, + n_type = data._type, + n_value = -1, + treeHierarchy = node.getTreeNodeHierarchy(item); + + // Avoid unnecessary reloads + if (_.isEqual($(this.sqlPanels[0]).data('node-prop'), treeHierarchy)) { + return; + } + // Cache the current IDs for next time + $(this.sqlPanels[0]).data('node-prop', treeHierarchy); + if (node.hasSQL) { - var self = this, - n_type = data._type, - n_value = -1, - treeHierarchy = node.getTreeNodeHierarchy(item); - - // Avoid unnecessary reloads - if (_.isUndefined(treeHierarchy[n_type]) || - _.isUndefined(treeHierarchy[n_type]._id)) { - n_value = -1; - } else { - n_value = treeHierarchy[n_type]._id; - } - - if (n_value == $(sqlPanels[0]).data(n_type)) { - return; - } - - // Cache the current IDs for next time - $(this.sqlPanels[0]).data(n_type, n_value); - sql = ''; var url = node.generate_url(item, 'sql', data, true); diff --git a/web/pgadmin/misc/statistics/static/js/statistics.js b/web/pgadmin/misc/statistics/static/js/statistics.js index f1217aea1..c1a032717 100644 --- a/web/pgadmin/misc/statistics/static/js/statistics.js +++ b/web/pgadmin/misc/statistics/static/js/statistics.js @@ -154,25 +154,16 @@ function(_, $, pgBrowser, Backgrid) { /* We fetch the statistics only for those node who set the parameter * showStatistics function. */ - if (node.hasStatistics) { // Avoid unnecessary reloads var treeHierarchy = node.getTreeNodeHierarchy(item); - if (_.isUndefined(treeHierarchy[n_type]) || - _.isUndefined(treeHierarchy[n_type]._id)) { - n_value = undefined, - n_value = -1; - } else { - n_value = treeHierarchy[n_type]._id; - } - - if (n_value == $(this.panel[0]).data(n_type)) { + if (_.isEqual($(panel[0]).data('node-prop'), treeHierarchy)) { return; } - // Cache the current IDs for next time - $(this.panel[0]).data(n_type, n_value); + $(panel[0]).data('node-prop', treeHierarchy); + if (node.hasStatistics) { /* Set the message because ajax request may take time to * fetch the information from the server. */