[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 17/119: javascript : add function to concat 2
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 17/119: javascript : add function to concat 2 json objects |
Date: |
Mon, 26 Oct 2020 18:27:05 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 18bf9951e7c5cbd470cc75e4849dba1c0959bafe
Author: Dany De Bontridder <dany@alchimerys.be>
AuthorDate: Sun Sep 27 10:55:59 2020 +0200
javascript : add function to concat 2 json objects
---
html/js/managetable.js | 5 +++--
html/js/scripts.js | 21 +++++++++++++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/html/js/managetable.js b/html/js/managetable.js
index d67e774..3d5d15f 100644
--- a/html/js/managetable.js
+++ b/html/js/managetable.js
@@ -189,18 +189,19 @@ var ManageTable = function (p_table_name)
* set
*/
this.save = function (form_id) {
+ var param_form={};
waiting_box();
try {
this.param['action'] = 'save';
var form = $(form_id).serialize(true);
- this.param_add(form);
+ param_form = json_concat(this.param,form);
var here=this;
} catch (e) {
alert(e.message);
return false;
}
new Ajax.Request(this.callback, {
- parameters: this.param,
+ parameters: param_form,
method: "post",
onSuccess: function (req) {
try {
diff --git a/html/js/scripts.js b/html/js/scripts.js
index f2f6e0c..9d93186 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -3665,3 +3665,24 @@ function toggle_row_warning_enable(p_enable, p_row)
$(p_row).hide();
}
}
+
+/**
+ * return a json object which is the merge of the 2 json objects
+ *
+ * @param p_json1 object 1 to merge
+ * @param p_json2 object 2 to merge
+ * @returns new json object
+ */
+function json_concat(p_json1,p_json2)
+{
+
+ var result = {};
+ for (var key in p_json1) {
+ result[key] = p_json1[key];
+ }
+ for (var key in p_json2) {
+ result[key] = p_json2[key];
+ }
+ return result;
+
+}
\ No newline at end of file
- [Noalyss-commit] [noalyss] 13/119: Bug 1834 : order POST over GET, (continued)
- [Noalyss-commit] [noalyss] 13/119: Bug 1834 : order POST over GET, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 05/119: Bug : syntax error, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 04/119: Bug : use ilike instead of tilde, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 02/119: Bug : correct search remove ~, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 08/119: remove extract, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 03/119: Merge branch 'master' of gitlab.noalyss.eu:noalyss/noalyss, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 01/119: Fix warning with empty array, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 10/119: Fix bug : cannot use % when searching NEW : space can be used now, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 14/119: doc, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 11/119: Improve use of the security, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 17/119: javascript : add function to concat 2 json objects,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 18/119: javascript: remove hardcoding of dialog box for manage_table, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 30/119: Bug 1834 : duplicate , cannot confirm an duplicated operation because the $_GET is taken in priority, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 29/119: Remove debug info, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 37/119: javascript: remove hardcoding of dialog box for manage_table, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 52/119: NEW Security : add tag, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 22/119: ManageTable : you can set the style of the dialog box, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 23/119: Rewriting of Predefined Operation. You can add new Predefined Operation, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 43/119: Documentation, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 50/119: Follow-up search : show the closing status, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 60/119: FollowUp Deatil : add the amount + tva from card, Dany De Bontridder, 2020/10/26