noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 121/151: Fix several issue in JS


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 121/151: Fix several issue in JS
Date: Sat, 4 Feb 2017 17:14:33 +0000 (UTC)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 5fd9bc0b13dd26f20bc1adf1ee3cd1fb2fde4fe0
Author: Dany De Bontridder <address@hidden>
Date:   Sat Jan 14 14:02:36 2017 +0100

    Fix several issue in JS
---
 html/js/managetable.js |   27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/html/js/managetable.js b/html/js/managetable.js
index 8a5e662..75299d9 100644
--- a/html/js/managetable.js
+++ b/html/js/managetable.js
@@ -64,6 +64,10 @@
  - input
  
  */
+/**
+ * @class ManageTable
+ * @param string p_table_name name of the table and schema
+ */
 
 var ManageTable = function (p_table_name)
 {
@@ -108,7 +112,7 @@ var ManageTable = function (p_table_name)
      private object "answer"
      @param req Ajax answer
      */
-    var parseXML = function (req) {
+    this.parseXML = function (req) {
         var xml = req.responseXML;
         var status = getElementsByTagName("status");
         var ctl = xml.getElementsByTagName("ctl");
@@ -121,7 +125,7 @@ var ManageTable = function (p_table_name)
         answer['status'] = getNodeText(status[0]);
         answer['ctl'] = getNodeText(ctl[0]);
         answer['html'] = getNodeText(html[0]);
-
+        return answer;
     };
     /**
      address@hidden call the ajax with the action save 
@@ -141,7 +145,7 @@ var ManageTable = function (p_table_name)
                 /// or add , the name of the row in the table has the
                 /// if p_ctl_row does not exist it means it is a new
                 /// row , otherwise an update
-                parseXML(req);
+                this.parseXML(req);
                 if (answer ['status'] == 'OK') {
                     if ($(answer['ctl'])) {
                         $(answer['ctl']).update(answer['html']);
@@ -174,14 +178,14 @@ var ManageTable = function (p_table_name)
             parameters: this.parm,
             method: "get",
             onSuccess: function (req) {
-                parseXML(req);
+                this.parseXML(req);
                 if (answer['status'] == 'OK') {
                     $(answer['ctl']).hide();
                 }
             }
 
         });
-    }
+    };
     /**
      address@hidden display a dialog box with the information
      * of the data row
@@ -192,17 +196,22 @@ var ManageTable = function (p_table_name)
         this.param['p_id'] = p_id;
         this.param['action'] = 'input';
         this.param['ctl_row'] = p_ctl_row;
+        var control = this.control;
+        var parsexml=this.parseXML;
         // display the form to enter data
         new Ajax.Request(this.callback, {
             parameters: this.param,
             method: "get",
             onSuccess: function (req) {
                 remove_waiting_box();
-                var obj = {"id": this.control, "cssclass": "inner_box", 
"html": loading()};
-                create_div(obj);
+                var x=parsexml(req);
+                console.log("x");
+                console.log(x);
+                var obj = {id:control, "cssclass": "inner_box", "html": 
loading()};
+                add_div(obj);
                 var pos = calcy(250);
-                $(this.control).setStyle({top: pos + 'px'});
-                obj.update(req.responseText);
+                 $(obj.id).setStyle({position:"absolute",top: pos + 
'px',width:"auto","margin-left":"10%"});
+                $(obj.id).update(req.responseText);
 
             }
         });



reply via email to

[Prev in Thread] Current Thread [Next in Thread]