From 602c08556d22219d61acbb9342a3cdabdb899bac Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 13 Apr 2021 16:00:43 -0600 Subject: [PATCH] Don't try quite so hard to search for select options It was finding & using ALL options if there was a namespace in the selectbox ID, but no options found. --- api/js/etemplate/et2_widget_selectbox.js | 2 +- api/js/etemplate/et2_widget_selectbox.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/et2_widget_selectbox.js b/api/js/etemplate/et2_widget_selectbox.js index 23c86ecaf7..293a207f0d 100644 --- a/api/js/etemplate/et2_widget_selectbox.js +++ b/api/js/etemplate/et2_widget_selectbox.js @@ -885,7 +885,7 @@ var et2_selectbox = /** @class */ (function (_super) { // Try name like widget[$row] if (name_parts.length > 1 && (!content_options || content_options.length == 0)) { var pop_that = jQuery.extend([], name_parts); - while (pop_that.length > 0 && (!content_options || content_options.length == 0)) { + while (pop_that.length > 1 && (!content_options || content_options.length == 0)) { var last = pop_that.pop(); content_options = widget.getArrayMgr('sel_options').getEntry(pop_that.join('[')); // Double check, might have found a normal parent namespace ( eg subgrid in subgrid[selectbox] ) diff --git a/api/js/etemplate/et2_widget_selectbox.ts b/api/js/etemplate/et2_widget_selectbox.ts index e26b57cf41..7743c6a18e 100644 --- a/api/js/etemplate/et2_widget_selectbox.ts +++ b/api/js/etemplate/et2_widget_selectbox.ts @@ -1180,7 +1180,7 @@ export class et2_selectbox extends et2_inputWidget if(name_parts.length > 1 && (!content_options || content_options.length == 0 )) { var pop_that = jQuery.extend([],name_parts); - while(pop_that.length > 0 && (!content_options || content_options.length == 0)) + while(pop_that.length > 1 && (!content_options || content_options.length == 0)) { var last = pop_that.pop(); content_options = widget.getArrayMgr('sel_options').getEntry(pop_that.join('['));