[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 40/119: ManageTable : you can set the style o
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 40/119: ManageTable : you can set the style of the dialog box |
Date: |
Mon, 26 Oct 2020 18:27:13 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit fa3ef8a59cfd0a4e72f6364f37ccc5ba8f9180ee
Author: Dany De Bontridder <dany@alchimerys.be>
AuthorDate: Tue Sep 29 18:04:56 2020 +0200
ManageTable : you can set the style of the dialog box
---
html/js/managetable.js | 7 +++++--
include/lib/manage_table_sql.class.php | 25 ++++++++++++++++++++++++-
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/html/js/managetable.js b/html/js/managetable.js
index 916ba0e..b6f2795 100644
--- a/html/js/managetable.js
+++ b/html/js/managetable.js
@@ -74,9 +74,12 @@ var ManageTable = function (p_table_name)
{
this.callback = "ajax.php"; //!< File to call
this.control = "dtr"; //<! Prefix Id of dialog box, table, row
-
+ this.mt_style={position: "fixed", top: '15%', width: "auto",
"margin-left": "20%"};
this.sort_column=0;
this.param = {"table": p_table_name, "ctl_id": this.control}; //<! default
value to pass
+ this.set_style=function(p_json) {
+ this.mt_style=p_json;
+ };
/**
* Set the sort ,
* @param {string} p_column column number start from 0
@@ -308,7 +311,7 @@ var ManageTable = function (p_table_name)
var obj = {id: control, "cssclass": "inner_box", "html":
loading()};
add_div(obj);
var pos = calcy(250);
- $(obj.id).setStyle({position: "fixed", top: '15%', width:
"auto", "margin-left": "20%"});
+ $(obj.id).setStyle(here.mt_style);
$(obj.id).update(x['html']);
} catch (e) {
smoke.alert(content[48] + e.message);
diff --git a/include/lib/manage_table_sql.class.php
b/include/lib/manage_table_sql.class.php
index 2047942..2078430 100644
--- a/include/lib/manage_table_sql.class.php
+++ b/include/lib/manage_table_sql.class.php
@@ -86,7 +86,7 @@ class Manage_Table_SQL
private $icon_mod; //!< place of right or left the icon update or mod,
default right, accepted value=left,right,first column for mod
private $icon_del; //!< place of right or left the icon update or mod,
default right, accepted value=left,right
-
+ private $dialogbox_style;
/**
* @brief Constructor : set the label to the column name,
* the order of the column , set the properties and the
@@ -123,6 +123,7 @@ class Manage_Table_SQL
// By default no js sort
$this->sort_column="";
$this->dialog_box="dtr";
+ $this->dialogbox_style=array("position"=> "fixed", "top"=>
'15%',"width"=> "auto", "margin-left"=> "20%");
}
/**
* send the XML headers for the ajax call
@@ -133,6 +134,26 @@ class Manage_Table_SQL
}
/**
+ * return the db_style
+ * @return array
+ */
+ public function get_dialogbox_style()
+ {
+ return $this->dialogbox_style;
+ }
+
+ /**
+ * Dialog box style , by default {position: "fixed", top: '15%', width:
"auto", "margin-left": "20%"}
+ *
+ * @param array $db_style , will be transformed into a json object
+ */
+ public function set_dialogbox_style($db_style)
+ {
+ $this->dialogbox_style = $db_style;
+ return $this;
+ }
+
+ /**
* @return mixed
*/
public function get_dialog_box()
@@ -378,6 +399,7 @@ function check()
*/
function create_js_script()
{
+ $style=json_encode($this->dialogbox_style);
echo "
<script>
var {$this->object_name}=new
ManageTable(\"{$this->table->table}\");
@@ -385,6 +407,7 @@ function check()
{$this->object_name}.param_add({$this->json_parameter});
{$this->object_name}.set_sort({$this->get_col_sort()});
{$this->object_name}.set_control(\"{$this->get_dialog_box()}\");
+ {$this->object_name}.set_style($style);
</script>
";
- [Noalyss-commit] [noalyss] 23/119: Rewriting of Predefined Operation. You can add new Predefined Operation, (continued)
- [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
- [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 <=
- [Noalyss-commit] [noalyss] 36/119: javascript : add function to concat 2 json objects, Dany De Bontridder, 2020/10/26
- [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