[icinga-checkins] icinga.org: icinga-web/mfriedrich/fixes: * Adding -NO DATA- display to grids
git at icinga.org
git at icinga.org
Mon Jan 10 09:04:58 CET 2011
Module: icinga-web
Branch: mfriedrich/fixes
Commit: 45da621534698ccd59f632e2861b0ebd8d8790c6
URL: https://git.icinga.org/?p=icinga-web.git;a=commit;h=45da621534698ccd59f632e2861b0ebd8d8790c6
Author: Marius Hein <marius.hein at netways.de>
Date: Wed Dec 8 15:52:26 2010 +0100
* Adding -NO DATA- display to grids
---
app/modules/Cronks/lib/js/grid/GridPanel.js | 17 ++++++++++++++++-
pub/styles/icinga.css | 4 ++++
2 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/app/modules/Cronks/lib/js/grid/GridPanel.js b/app/modules/Cronks/lib/js/grid/GridPanel.js
index 08af7c5..aefcb21 100755
--- a/app/modules/Cronks/lib/js/grid/GridPanel.js
+++ b/app/modules/Cronks/lib/js/grid/GridPanel.js
@@ -8,10 +8,25 @@ Cronk.grid.GridPanel = Ext.extend(Ext.grid.GridPanel, {
initComponent : function() {
this.tbar = this.buildTopToolbar();
+ _G = this;
+
+ if (this.store) {
+ // Add nodata background
+ this.store.on('datachanged', function(store) {
+ if (store.getCount() == 0) {
+ _G.getGridEl().child('div').addClass('x-icinga-nodata');
+ }
+ else {
+ _G.getGridEl().child('div').removeClass('x-icinga-nodata');
+ }
+ });
+ }
Cronk.grid.GridPanel.superclass.initComponent.call(this);
},
- // Top toolbar of the grid
+ /*
+ * Top toolbar of the grid
+ */
buildTopToolbar : function() {
var autoRefresh = AppKit.getPrefVal('org.icinga.grid.refreshTime') || 300;
diff --git a/pub/styles/icinga.css b/pub/styles/icinga.css
index 09af27f..f45b600 100644
--- a/pub/styles/icinga.css
+++ b/pub/styles/icinga.css
@@ -556,6 +556,10 @@ table.icinga-detailed-info td.key {
border: 1px #00cc00 solid;
}
+.x-icinga-nodata {
+ background: transparent url("../images/background/nodata.png") center center no-repeat;
+}
+
/** Static content container **/
.static-content-container {
background-color: #ffffff;
More information about the icinga-checkins
mailing list