Subject: PATCH: resolving issue in casts as functions are not being fetched due to change in node.ui.js

From: Sanket Mehta <[email-masked]>
Date: Fri, 22 Apr 2016 16:34:26 +0530

Hi,

Due to commit id 944bdbb96c3b360c856d7586144b835e44afac43 in node.ui.js,
functions were not being fetched after selecting source and target types as
I have overridden the options property for functions select control.

I have resolved that issue and patch is attached with this mail.

Please do review it.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/templates/cast/js/casts.js b/web/pgadmin/browser/server_groups/servers/databases/casts/templates/cast/js/casts.js
index 690a6d5..0010222 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/casts/templates/cast/js/casts.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/templates/cast/js/casts.js
@@ -177,20 +177,19 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
             type: 'text', disabled: function(m) { return !m.isNew(); },
             group: 'Definition', mode: ['create'],
             control: 'node-ajax-options',
-            options: function() {
-
-              var srcTyp = this.model.get('srctyp');
-              var trgtyp = this.model.get('trgtyp');
+            options: function(control) {
+              var srcTyp = control.model.get('srctyp');
+              var trgtyp = control.model.get('trgtyp');
               var res = [];
 
               if(srcTyp != undefined && srcTyp != '' &&
                  trgtyp != undefined && trgtyp != '')
               {
-                 var node = this.field.get('schema_node'),
+                 var node = control.field.get('schema_node'),
                  _url = node.generate_url.apply(
                  node, [
-                   null, 'get_functions', this.field.get('node_data'), false,
-                   this.field.get('node_info')
+                   null, 'get_functions', control.field.get('node_data'), false,
+                   control.field.get('node_info')
                  ]);
                  $.ajax({
                  type: 'POST',

-- 
Sent via pgadmin-hackers mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

---

From: Ashesh Vashi <[email-masked]>
Date: Fri, 22 Apr 2016 18:07:13 +0530

Committed!

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company
<http://www.enterprisedb.com>

*http://www.linkedin.com/in/asheshvashi*
<http://www.linkedin.com/in/asheshvashi>

On Fri, Apr 22, 2016 at 4:34 PM, Sanket Mehta <[email-masked]
> wrote:

> functions were not being fetched after selecting source and target types
> as I have overridden the options property for functions select control.
>