[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);
}
});
- [Noalyss-commit] [noalyss] 147/151: Return must be after throw, (continued)
- [Noalyss-commit] [noalyss] 147/151: Return must be after throw, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 141/151: ManageTable colorize the row in alternate, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 150/151: Improve Doxygen setting, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 133/151: Correct Manage Table , finish implementing, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 03/151: CSS : Update style mobile, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 57/151: CSS : Update style mobile, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 117/151: Indent properly, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 89/151: remove debug info, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 114/151: Move class_table_sql to lib , since it is usable without Noalyss, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 127/151: Add the noalyss version in the info page, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 121/151: Fix several issue in JS,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 98/151: Correct simul.py remove old file, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 146/151: Merge branch 'master' of ns3:/srv/git/noalyss, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 142/151: Doc : complete documentation, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 119/151: correct syntax, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 151/151: Improve description, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 145/151: change name alternate_row_color, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 137/151: Remove console.log from JS Safer function for XML (problem with escaping), Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 122/151: Test ManageTable ; fix several bugs and add the ajax answer , it not yet finished, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 62/151: Experiment less, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 149/151: Correct doxygen, Dany De Bontridder, 2017/02/04