[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 141/151: ManageTable colorize the row in alte
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 141/151: ManageTable colorize the row in alternate |
Date: |
Sat, 4 Feb 2017 17:14:35 +0000 (UTC) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit c680698c896dff51279c8d9c52114895e9a66bc8
Author: Dany De Bontridder <address@hidden>
Date: Wed Jan 25 23:11:11 2017 +0100
ManageTable colorize the row in alternate
---
html/image/edit.png | Bin 745 -> 607 bytes
html/js/managetable.js | 2 ++
html/js/scripts.js | 31 +++++++++++++++++++++++++++++++
include/lib/class_manage_table_sql.php | 7 +++++++
4 files changed, 40 insertions(+)
diff --git a/html/image/edit.png b/html/image/edit.png
index 54b5c9a..5da8323 100644
Binary files a/html/image/edit.png and b/html/image/edit.png differ
diff --git a/html/js/managetable.js b/html/js/managetable.js
index 74b6fc2..9dfed0b 100644
--- a/html/js/managetable.js
+++ b/html/js/managetable.js
@@ -178,6 +178,7 @@ var ManageTable = function (p_table_name)
smoke.alert("Changement impossible");
throw "error in save";
}
+ alternate_row("tb"+answer['ctl']);
remove_waiting_box();
$("dtr").hide();
} catch (e) {
@@ -211,6 +212,7 @@ var ManageTable = function (p_table_name)
if (answer['status'] == 'OK') {
var x=answer['ctl_row'];
$(x).hide();
+ alternate_row("tb"+answer['ctl']);
}else {
smoke.alert("Effacement impossible");
}
diff --git a/html/js/scripts.js b/html/js/scripts.js
index 9be5863..c1ac848 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -2937,3 +2937,34 @@ window.onload=function ()
init_scroll();
sorttable.init
}
+/**
+ * @brief Colorize the rows of the table
+ * @param string p_table id of the table
+ */
+function alternate_row(p_table)
+{
+ var len = $(p_table).tBodies[0].rows.length;
+ var i = 0;
+ var localClass = "";
+ for (i = 1; i < len; i++) {
+ localClass = (i % 2 == 0) ? "even" : "odd";
+ if (localClass == "even" &&
$(p_table).tBodies[0].rows[i].hasClassName("odd"))
+ {
+ $(p_table).tBodies[0].rows[i].removeClassName("odd");
+ }
+ if (localClass == "even" &&
!$(p_table).tBodies[0].rows[i].hasClassName("even"))
+ {
+ $(p_table).tBodies[0].rows[i].addClassName("even");
+ }
+
+ if (localClass == "odd" &&
$(p_table).tBodies[0].rows[i].hasClassName("even"))
+ {
+ $(p_table).tBodies[0].rows[i].removeClassName("even");
+ }
+ if (localClass == "odd" &&
!$(p_table).tBodies[0].rows[i].hasClassName("odd"))
+ {
+ $(p_table).tBodies[0].rows[i].addClassName("odd");
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/include/lib/class_manage_table_sql.php
b/include/lib/class_manage_table_sql.php
index 8dc931e..87432cb 100644
--- a/include/lib/class_manage_table_sql.php
+++ b/include/lib/class_manage_table_sql.php
@@ -423,6 +423,7 @@ class Manage_Table_SQL
sprintf("%s.input('-1','%s')", $this->object_name,
$this->object_name));
}
+ printf ('<script> alternate_row("tb%s");</script>',
$this->object_name);
}
/**
@@ -442,6 +443,12 @@ class Manage_Table_SQL
if ($this->get_property_visible($key)==true)
echo th($this->a_label_displaid[$key]);
}
+ if ($this->can_update_row()) {
+ echo td(_('Modifier'));
+ }
+ if ($this->can_delete_row()) {
+ echo td(_('Effacer'));
+ }
echo "</tr>";
}
- [Noalyss-commit] [noalyss] 110/151: Add property in Manage_Table VISIBLE UPDATABLE, (continued)
- [Noalyss-commit] [noalyss] 110/151: Add property in Manage_Table VISIBLE UPDATABLE, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 125/151: Test ManageTable ; fix parseXML function, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 144/151: Merge branch 'master' of ns3:/srv/git/noalyss, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 09/151: Experiment less, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 123/151: Test ManageTable ; fix parseXML function, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 126/151: Correct js : this of the object is not callable from a nested function, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 135/151: Fix bug : duplicate doesn't take in account the TVA_ID, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 148/151: Missing col in ANC_TABLE, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 111/151: Improve Manage_Table_SQL : add functions for javascript , update or visible flag ..., Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 147/151: Return must be after throw, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 141/151: ManageTable colorize the row in alternate,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 150/151: Improve Doxygen setting, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 133/151: Correct Manage Table , finish implementing, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 03/151: CSS : Update style mobile, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 57/151: CSS : Update style mobile, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 117/151: Indent properly, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 89/151: remove debug info, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 114/151: Move class_table_sql to lib , since it is usable without Noalyss, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 127/151: Add the noalyss version in the info page, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 121/151: Fix several issue in JS, Dany De Bontridder, 2017/02/04
- [Noalyss-commit] [noalyss] 98/151: Correct simul.py remove old file, Dany De Bontridder, 2017/02/04