[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 14/238: INum : add function onchange with inp
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 14/238: INum : add function onchange with inplace edit |
Date: |
Sat, 26 Oct 2019 04:40:16 -0400 (EDT) |
sparkyx pushed a commit to annotated tag rel7110
in repository noalyss.
commit 8d8f5215724ba8d5100ae0055b4ff81321e07b27
Author: Dany De Bontridder <address@hidden>
Date: Tue May 1 21:54:12 2018 +0200
INum : add function onchange with inplace edit
---
include/lib/inum.class.php | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/include/lib/inum.class.php b/include/lib/inum.class.php
index e6375fe..489ccef 100644
--- a/include/lib/inum.class.php
+++ b/include/lib/inum.class.php
@@ -114,5 +114,42 @@ class INum extends IText
return $r;
}
+ /**
+ *
+ * @parameter $p_js_update optionnal script to execute if we update the
fied
+ * @return string
+ */
+ function change($p_js_update="")
+ {
+ if ( $this->id=="") {
+ $this->id=uniqid();
+ }
+ $id_read=sprintf("x1_span_%s",$this->id);
+ $id_input=sprintf("x2_span_%s",$this->id);
+
+ $p_javascript_read=sprintf("$('%s').hide();$('%s').show();",
+ $id_read,$id_input);
+
+ $p_javascript_input=sprintf("$('%s').hide();$('%s').show();",
+ $id_input,$id_read);
+
+
$p_javascript_update=sprintf("$('update_%s').innerHTML=$('%s').value;$('%s').hide();$('%s').show();$p_js_update",
+ $this->id,
+ $this->id,
+ $id_input,$id_read);
+
+ $r=sprintf('<span id="%s">',$id_read);
+ $r.=sprintf('<span id="update_%s">',$this->id).$this->value.'</span>';
+ $r.=Icon_Action::modify(uniqid(), $p_javascript_read);
+ $r.='</span>';
+
+ $r.=sprintf('<span id="%s" style="display:none">',$id_input);
+ $r.=$this->input();
+ $r.=Icon_Action::validate(uniqid(), $p_javascript_update);
+ $r.=Icon_Action::cancel(uniqid(), $p_javascript_input);
+ $r.='</span>';
+ return $r;
+
+ }
}
- [Noalyss-commit] [noalyss] annotated tag rel7110 created (now 7217362), Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 03/238: Currency : create view + add currency name to table currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 09/238: Currency : add security for setting, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 01/238: create currency SQL tables, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 05/238: html_page_start : protect query, improve code, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 02/238: Currency : add PHP Class for SQL table, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 07/238: Currency : add menu for currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 11/238: Currency : SQL menu change, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 08/238: Currency = add a mode currency, possible to work without, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 13/238: indent, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 14/238: INum : add function onchange with inplace edit,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 15/238: insert_jrnx : add debug, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 04/238: Currency : add test file + database file + mtable, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 12/238: Action_Code : add validate, cancel and modify icon, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 22/238: Task #448 : identical operation with currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 24/238: Task #448 : rounded value for VEN, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 10/238: Currency : add SQL constraint + doc, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 17/238: Currency : fix rounded bugs in detail operation, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 19/238: Task #448 : currency : cosmetic operation detail, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 27/238: Task #448 : delete unused currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 18/238: task #448 : Currency : display currency info into operation detail, Dany De Bontridder, 2019/10/26