[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 123/151: Test ManageTable ; fix parseXML func
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 123/151: Test ManageTable ; fix parseXML function |
Date: |
Sat, 4 Feb 2017 17:14:33 +0000 (UTC) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit ca1098946e2d8e7111fcd0dd0e2013d7d6873860
Author: Dany De Bontridder <address@hidden>
Date: Sat Jan 14 14:33:42 2017 +0100
Test ManageTable ; fix parseXML function
---
html/js/managetable.js | 59 ++++++++++++++++++++++++------------------------
1 file changed, 30 insertions(+), 29 deletions(-)
diff --git a/html/js/managetable.js b/html/js/managetable.js
index deac84f..cb0f12d 100644
--- a/html/js/managetable.js
+++ b/html/js/managetable.js
@@ -65,33 +65,6 @@
*/
/**
- @brief receive answer from ajax and fill up the
- private object "answer"
- @param req Ajax answer
- */
-var parseXML = function (req) {
- console.log(" start parsing");
- console.log(req.responseText);
- try {
- var xml = req.responseXML;
- var status = getElementsByTagName("status");
- var ctl = xml.getElementsByTagName("ctl");
- var html = xml.getElementsByTagName("html");
- if (status.length == 0 || ctl.length == 0 || html.length == 0)
- {
- throw "Invalid answer " + req.responseText;
-
- }
- answer['status'] = getNodeText(status[0]);
- answer['ctl'] = getNodeText(ctl[0]);
- answer['html'] = getNodeText(html[0]);
- return answer;
- } catch (e) {
- console.log("erreur parsing");
- throw e;
- }
-};
-/**
* @class ManageTable
* @param string p_table_name name of the table and schema
*/
@@ -135,6 +108,33 @@ var ManageTable = function (p_table_name)
this.param = result;
return this.param;
};
+ /**
+ @brief receive answer from ajax and fill up the
+ private object "answer"
+ @param req Ajax answer
+ */
+ this.parseXML = function (req) {
+ console.log(" start parsing");
+ console.log(req.responseText);
+ try {
+ var xml = req.responseXML;
+ var status = getElementsByTagName("status");
+ var ctl = xml.getElementsByTagName("ctl");
+ var html = xml.getElementsByTagName("html");
+ if (status.length == 0 || ctl.length == 0 || html.length == 0)
+ {
+ throw "Invalid answer " + req.responseText;
+
+ }
+ answer['status'] = getNodeText(status[0]);
+ answer['ctl'] = getNodeText(ctl[0]);
+ answer['html'] = getNodeText(html[0]);
+ return answer;
+ } catch (e) {
+ console.log("erreur parsing");
+ throw e;
+ }
+ };
/**
address@hidden call the ajax with the action save
@@ -154,7 +154,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
- this.parseXML(req);
+ here.parseXML(req);
if (answer ['status'] == 'OK') {
if ($(answer['ctl'])) {
$(answer['ctl']).update(answer['html']);
@@ -206,6 +206,7 @@ var ManageTable = function (p_table_name)
this.param['action'] = 'input';
this.param['ctl_row'] = p_ctl_row;
var control = this.control;
+ var here = this;
// display the form to enter data
new Ajax.Request(this.callback, {
parameters: this.param,
@@ -214,7 +215,7 @@ var ManageTable = function (p_table_name)
remove_waiting_box();
try {
console.log("parse xml");
- var x = parseXML(req);
+ var x = here.parseXML(req);
console.log("x");
console.log(x);
console.log("create div");
- [Noalyss-commit] [noalyss] 112/151: Improve Doxygen doc, (continued)
- [Noalyss-commit] [noalyss] 112/151: Improve Doxygen doc, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 73/151: Export en PDF d'operation, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 143/151: Fix : when exporting files for creating a PDF in ANC , the filename can be a problem if he contains some char., Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 116/151: Manage_Table , the js and php code are been splitted in 2 files , the ajax calls are nearly done , doxygen for these files is correct, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 101/151: Deprecated HtmlInput::make_object must be replace by json_encode, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 99/151: Improve Sorttable, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 110/151: Add property in Manage_Table VISIBLE UPDATABLE, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 125/151: Test ManageTable ; fix parseXML function, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 144/151: Merge branch 'master' of ns3:/srv/git/noalyss, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 09/151: Experiment less, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 123/151: Test ManageTable ; fix parseXML function,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 126/151: Correct js : this of the object is not callable from a nested function, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 135/151: Fix bug : duplicate doesn't take in account the TVA_ID, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 148/151: Missing col in ANC_TABLE, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 111/151: Improve Manage_Table_SQL : add functions for javascript , update or visible flag ..., Dany De Bontridder, 2017/02/04
- [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