Module: check_mk
Branch: master
Commit: f88deb59ca7ad8d63fc4e099a9265731f9a25c87
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f88deb59ca7ad8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 8 12:22:51 2011 +0200
WATO: All hosts in hostlists are preselected now
---
web/htdocs/htmllib.py | 10 ----------
web/htdocs/wato.py | 4 +++-
web/plugins/views/layouts.py | 10 +++++++++-
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 9de3262..c9cbc4d 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -790,13 +790,3 @@ class html:
def end_foldable_container(self):
self.write("</ul>")
-
- def init_rowselect(self):
- selected = []
- if self.has_var('selected_rows'):
- selected_rows = self.var('selected_rows', '')
- if selected_rows or ',' in selected_rows:
- selected = selected_rows.split(',')
-
- self.javascript('g_selected_rows = %s;\n'
- 'init_rowselect();' % repr(selected))
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 3eaee89..9815934 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -743,7 +743,9 @@ def mode_file(phase):
html.hidden_fields()
html.end_form()
- html.init_rowselect()
+
+ html.javascript('g_selected_rows = %s;\n'
+ 'init_rowselect();' % repr(hostnames))
# Create list of all hosts that are select with checkboxes in the current file
def get_hostnames_from_checkboxes():
diff --git a/web/plugins/views/layouts.py b/web/plugins/views/layouts.py
index aa3030c..8172b35 100644
--- a/web/plugins/views/layouts.py
+++ b/web/plugins/views/layouts.py
@@ -28,7 +28,15 @@ def init_rowselect():
# Don't make rows selectable when no commands can be fired
if not 'C' in html.display_options or not config.may("act"):
return
- html.init_rowselect()
+
+ selected = []
+ if html.has_var('selected_rows'):
+ selected_rows = html.var('selected_rows', '')
+ if selected_rows or ',' in selected_rows:
+ selected = selected_rows.split(',')
+
+ html.javascript('g_selected_rows = %s;\n'
+ 'init_rowselect();' % repr(selected))
def render_checkbox(view, row, num_tds):
# value contains the number of columns of this datarow. This is