From 3ab17d49194853ed0b4a004b262e87eba5df708a Mon Sep 17 00:00:00 2001 From: Sam Stenvall Date: Tue, 5 Aug 2014 16:09:40 +0300 Subject: [PATCH] [webui] make CheckColumn obey readonly status --- src/webui/static/checkcolumn/CheckColumn.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/webui/static/checkcolumn/CheckColumn.js b/src/webui/static/checkcolumn/CheckColumn.js index 8ebf47bf..7201cc28 100644 --- a/src/webui/static/checkcolumn/CheckColumn.js +++ b/src/webui/static/checkcolumn/CheckColumn.js @@ -43,6 +43,8 @@ Ext.ux.grid.CheckColumn = Ext.extend(Ext.grid.Column, { * Process and refire events routed from the GridView's processEvent method. */ processEvent : function(name, e, grid, rowIndex, colIndex){ + if (!this.editable) + return false; if (name == 'mousedown') { var record = grid.store.getAt(rowIndex); record.set(this.dataIndex, !record.data[this.dataIndex]); @@ -54,7 +56,8 @@ Ext.ux.grid.CheckColumn = Ext.extend(Ext.grid.Column, { renderer : function(v, p, record){ p.css += ' x-grid3-check-col-td'; - return String.format('
 
', v ? '-on' : ''); + var cssClass = 'x-grid3-check-col{0}' + (!this.editable ? ' x-item-disabled' : ''); + return String.format('
 
', v ? '-on' : ''); }, // Deprecate use as a plugin. Remove in 4.0