[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 36/119: javascript : add function to concat 2
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 36/119: javascript : add function to concat 2 json objects |
Date: |
Mon, 26 Oct 2020 18:27:12 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 0982ee1c4abcca2cb235fef754c966eb93ab637f
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 959788c..4451f83 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -3673,3 +3673,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] 43/119: Documentation, (continued)
- [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
- [Noalyss-commit] [noalyss] 74/119: Search concerned card with company , name , ... and export contact option to CSV, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 80/119: Follow Up : multiple card , search by category of card, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 15/119: doc, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 19/119: fix type, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 20/119: documentation, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 26/119: FollowUp : new right : delete action, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 40/119: ManageTable : you can set the style of the dialog box, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 36/119: javascript : add function to concat 2 json objects,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 32/119: Bug : syntax error, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 31/119: Bug : use ilike instead of tilde, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 46/119: Follow-up : tag enable when create doc, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 48/119: Action and Document Add missing files, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 57/119: Upgrade DB to 145, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 54/119: Contact option , allow to use option for contact, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 70/119: Card can be disable if not used anymore, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 73/119: Contact option : export CSV, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 67/119: Link between contact option and document, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 75/119: Fix : by default new contact options were not added to document_type, Dany De Bontridder, 2020/10/26