noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 01/10: Manage_Table : add CSS Class


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 01/10: Manage_Table : add CSS Class
Date: Sun, 28 Mar 2021 09:22:02 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 6f169caf78d4223be5611b194068656d7609a092
Author: Dany De Bontridder <dany@alchimerys.be>
AuthorDate: Fri Mar 12 10:09:39 2021 +0100

    Manage_Table : add CSS Class
---
 html/js/managetable.js                 |  7 +++++--
 include/lib/manage_table_sql.class.php | 18 ++++++++++++++++--
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/html/js/managetable.js b/html/js/managetable.js
index da5b860..78c2ddd 100644
--- a/html/js/managetable.js
+++ b/html/js/managetable.js
@@ -76,6 +76,7 @@ var ManageTable = function (p_table_name)
     this.control = "dtr"; //<! Prefix Id of dialog box, table, row
     this.mt_style={position: "fixed", top:  '15%', width: "auto", 
"max-width":"60%","margin-left": "20%"};
     this.sort_column=0;
+    this.cssclass="inner_box";
     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;
@@ -308,13 +309,15 @@ var ManageTable = function (p_table_name)
                 remove_waiting_box();
                 try {
                     var x = here.parseXML(req);
-                    var obj = {id: control, "cssclass": "inner_box", "html": 
loading()};
+                    var obj = {id: control, "cssclass": here.cssclass, "html": 
loading()};
                     add_div(obj);
-                    var pos = calcy(250);
+                    var pos = calcy(50);
                     if (window.innerWidth < 1200) {
                         here.mt_style["margin-left"]="2%";
                         here.mt_style["max-width"]="80%";
                     }
+                    here.mt_style["position"]="absolute";
+                    here.mt_style["top"]=pos+"px";
                     console.log(here.mt_style);
                     $(obj.id).setStyle(here.mt_style);
                     $(obj.id).update(x['html']);
diff --git a/include/lib/manage_table_sql.class.php 
b/include/lib/manage_table_sql.class.php
index 2b56a3e..9e78042 100644
--- a/include/lib/manage_table_sql.class.php
+++ b/include/lib/manage_table_sql.class.php
@@ -88,9 +88,11 @@ 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; 
+    private $dialogbox_style; //!< style of the dialog box
     private $button_add_top;  //!< place of the button add on the top, by 
default true
     protected $title; //! < give the title of the diabox , default is Data
+    private $cssclass; //! CSS class for the dialog box
+    
     /**
      * @brief Constructor : set the label to the column name,
      * the order of the column , set the properties and the
@@ -133,7 +135,15 @@ class Manage_Table_SQL
         $this->search_table=true;
         $this->button_add_top=true;
         $this->title=_("Donnée");
+        $this->cssclass="inner_box";
+        
     }
+    function setCssClass($p_class) {
+               $this->cssclass=$p_class;
+       }
+       function getCssClass() {
+               return $this->cssclass;
+       }
     /**
      * Set the title of the diabox , default is Donnée
      * @param type $p_title
@@ -450,6 +460,7 @@ function check()
                {$this->object_name}.set_sort({$this->get_col_sort()});
                {$this->object_name}.set_control(\"{$this->get_dialog_box()}\");
                {$this->object_name}.set_style($style);
+               {$this->object_name}.cssclass=\"{$this->cssclass}\";
                </script>
 
        ";
@@ -978,7 +989,10 @@ function check()
     /**
      * @brief display into a dialog box the datarow in order 
      * to be appended or modified. Can be override if you need
-     * a more complex form.
+     * a more complex form or add elements with "set_order" before 
+     * calling this function. 
+     * This function does not add the form , only the table, 
+     *  
      */
     function input()
     {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]