diff --git a/etemplate/js/et2_core_arrayMgr.js b/etemplate/js/et2_core_arrayMgr.js index c7b29c16b0..7c442f1274 100644 --- a/etemplate/js/et2_core_arrayMgr.js +++ b/etemplate/js/et2_core_arrayMgr.js @@ -40,14 +40,14 @@ var et2_arrayMgr = Class.extend({ } // Expand sub-arrays that have been shmushed together, so further perspectives work - // Shmushed keys look like: ${row}[info_cat] + // Shmushed keys look like: ${row}[info_cat] // Expanded: ${row}: Object{info_cat: ..value} if (this.splitIds) { // For each index, we need a key: {..} sub array for(var key in _data) { // Split up indexes - var indexes = key.split('['); + var indexes = key.replace('[','[').split('['); // Put data in the proper place if(indexes.length > 1) @@ -55,7 +55,7 @@ var et2_arrayMgr = Class.extend({ var value = _data[key]; var target = _data; for(var i = 0; i < indexes.length; i++) { - indexes[i] = indexes[i].replace(']',''); + indexes[i] = indexes[i].replace(']','').replace(']',''); if(typeof target[indexes[i]] == "undefined") { target[indexes[i]] = i == indexes.length-1 ? value : {}; } diff --git a/etemplate/js/et2_widget_selectbox.js b/etemplate/js/et2_widget_selectbox.js index bbd4463762..cb89ec16dd 100644 --- a/etemplate/js/et2_widget_selectbox.js +++ b/etemplate/js/et2_widget_selectbox.js @@ -124,8 +124,16 @@ var et2_selectbox = et2_inputWidget.extend({ content_options = this.getArrayMgr("sel_options").getRoot().getEntry(name_parts[name_parts.length-1]); } + // Try in correct namespace (inside a grid or something) + if(!content_options || content_options.length == 0) + { + content_options = this.getArrayMgr("sel_options").getEntry(name_parts[name_parts.length-1]); + } + // Maybe in a row, and options got stuck in ${row} instead of top level - if((!content_options || content_options.length == 0) && this.getArrayMgr("sel_options").perspectiveData.row) + if((!content_options || content_options.length == 0) && ( + // perspectiveData.row in nm, data["${row}"] in an auto-repeat grid + this.getArrayMgr("sel_options").perspectiveData.row || this.getArrayMgr("sel_options").data["${row}"])) { var row_id = this.id.replace(/[0-9]+/,'${row}'); content_options = this.getArrayMgr("sel_options").getEntry(row_id); diff --git a/etemplate/js/etemplate2.js b/etemplate/js/etemplate2.js index 611465e634..8f3eac1816 100644 --- a/etemplate/js/etemplate2.js +++ b/etemplate/js/etemplate2.js @@ -162,6 +162,9 @@ etemplate2.prototype._createArrayManagers = function(_data) */ etemplate2.prototype.load = function(_name, _url, _data) { + + egw().debug("info", "Loaded data", _data); + // Appname should be first part of the template name var split = _name.split('.'); var appname = split[0];