From 3b65d807ba0bb40fbd228a84d9ebe68b6fe00eaf Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 26 Aug 2013 16:42:49 +0000 Subject: [PATCH] Better handling for disabled columns. Disabled grid columns don't create widgets, which caused the nm issues as it expected a widget in each cell. --- etemplate/js/et2_extension_nextmatch.js | 17 +++++++++++++++++ .../js/et2_extension_nextmatch_rowProvider.js | 3 +++ 2 files changed, 20 insertions(+) diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index 60e84b78e0..515a6ba18f 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -579,6 +579,12 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], RowLoop: for(var i = 0; i < _row.length; i++) { + if(_row[i].disabled) + { + _colData[i].disabled = true; + continue; + } + // Customfields needs special processing if(_row[i].widget.instanceOf(et2_nextmatch_customfields)) { @@ -692,6 +698,17 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], }, _parseHeaderRow: function(_row, _colData) { + + // Make sure there's a widget - cols disabled in template can be missing them, and the header really likes to have a widget + + for (var x = 0; x < _row.length; x++) + { + if(!_row[x].widget) + { + _row[x].widget = et2_createWidget("label"); + } + } + // Get column display preference this._applyUserPreferences(_row, _colData); diff --git a/etemplate/js/et2_extension_nextmatch_rowProvider.js b/etemplate/js/et2_extension_nextmatch_rowProvider.js index 02111cb4ca..b103de51c8 100644 --- a/etemplate/js/et2_extension_nextmatch_rowProvider.js +++ b/etemplate/js/et2_extension_nextmatch_rowProvider.js @@ -547,6 +547,9 @@ var et2_nextmatch_rowWidget = et2_widget.extend(et2_IDOMNode, this._widgets = new Array(_widgets.length); for (var i = 0; i < _widgets.length; i++) { + // Disabled columns might be missing widget - skip it + if(!_widgets[i]) continue; + this._widgets[i] = _widgets[i].clone(this); this._widgets[i].loadingFinished(); // Set column alignment from widget