public inbox for [email protected]
help / color / mirror / Atom feedFrom: Harshal Dhumal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: patch for RM1497
Date: Mon, 25 Jul 2016 16:47:40 +0530
Message-ID: <CAFiP3vwOju58c3P4vC0rMwyUq4W=O-oOvaNL8Mypneg6w9iWvQ@mail.gmail.com> (raw)
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgadmin-hackers>
Hi,
PFA attached for rm1497
Issue: fixed js error while re-rendering shubnode grid
--
*Harshal Dhumal*
*Software Engineer*
EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
Attachments:
[text/x-patch] RM1497.patch (3.8K, 3-RM1497.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/templates/foreign_key/js/foreign_key.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/templates/foreign_key/js/foreign_key.js
index b404d46..6bd6195 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/templates/foreign_key/js/foreign_key.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/templates/foreign_key/js/foreign_key.js
@@ -371,6 +371,11 @@ function($, _, S, pgAdmin, pgBrowser, Alertify) {
titleTmpl({label: data.label})
);
+ // Clean up existing grid if any (in case of re-render)
+ if (self.grid) {
+ self.grid.remove();
+ }
+
$gridBody.append(self.generateHeader(data));
var gridSchema = _.clone(this.gridSchema);
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/variable.js b/web/pgadmin/browser/server_groups/servers/static/js/variable.js
index 565c266..1413dbc 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/variable.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/variable.js
@@ -380,6 +380,11 @@
titleTmpl(data)
);
+ // Clean up existing grid if any (in case of re-render)
+ if (self.grid) {
+ self.grid.remove();
+ }
+
var gridSchema = _.clone(this.gridSchema);
_.each(gridSchema.columns, function(col) {
diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js
index 985ed46..eadea8a 100644
--- a/web/pgadmin/static/js/backform.pgadmin.js
+++ b/web/pgadmin/static/js/backform.pgadmin.js
@@ -967,7 +967,8 @@
return this;
},
showGridControl: function(data) {
- var gridHeader = _.template([
+ var self = this,
+ gridHeader = _.template([
'<div class="subnode-header">',
' <label class="control-label pg-el-sm-10"><%-label%></label>',
' <button class="btn-sm btn-default add" <%=canAdd ? "" : "disabled=\'disabled\'"%>><%-add_label%></buttton>',
@@ -976,6 +977,11 @@
gridHeader(data)
);
+ // Clean up existing grid if any (in case of re-render)
+ if (self.grid) {
+ self.grid.remove();
+ }
+
if (!(data.subnode)) {
return '';
}
@@ -983,8 +989,7 @@
var subnode = data.subnode.schema ? data.subnode : data.subnode.prototype,
gridSchema = Backform.generateGridColumnsFromModel(
data.node_info, subnode, this.field.get('mode'), data.columns
- ),
- self = this;
+ );
// Set visibility of Add button
if (data.mode == 'properties') {
@@ -1201,7 +1206,8 @@
return this;
},
showGridControl: function(data) {
- var gridHeader = ["<div class='subnode-header'>",
+ var self = this,
+ gridHeader = ["<div class='subnode-header'>",
" <label class='control-label pg-el-sm-10'>" + data.label + "</label>" ,
" <button class='btn-sm btn-default add'>Add</buttton>",
"</div>"].join("\n");
@@ -1210,9 +1216,14 @@
var subnode = data.subnode.schema ? data.subnode : data.subnode.prototype,
gridSchema = Backform.generateGridColumnsFromModel(
data.node_info, subnode, this.field.get('mode'), data.columns, data.schema_node
- ), self = this,
+ ),
pgBrowser = window.pgAdmin.Browser;
+ // Clean up existing grid if any (in case of re-render)
+ if (self.grid) {
+ self.grid.remove();
+ }
+
// Set visibility of Add button
if (data.disabled || data.canAdd == false) {
$(gridBody).find("button.add").remove();
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: patch for RM1497
In-Reply-To: <CAFiP3vwOju58c3P4vC0rMwyUq4W=O-oOvaNL8Mypneg6w9iWvQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox