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.
This commit is contained in:
nathangray 2021-04-13 16:00:43 -06:00
parent 05e80af654
commit 602c08556d
2 changed files with 2 additions and 2 deletions

View File

@ -885,7 +885,7 @@ var et2_selectbox = /** @class */ (function (_super) {
// Try name like widget[$row] // Try name like widget[$row]
if (name_parts.length > 1 && (!content_options || content_options.length == 0)) { if (name_parts.length > 1 && (!content_options || content_options.length == 0)) {
var pop_that = jQuery.extend([], name_parts); 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(); var last = pop_that.pop();
content_options = widget.getArrayMgr('sel_options').getEntry(pop_that.join('[')); content_options = widget.getArrayMgr('sel_options').getEntry(pop_that.join('['));
// Double check, might have found a normal parent namespace ( eg subgrid in subgrid[selectbox] ) // Double check, might have found a normal parent namespace ( eg subgrid in subgrid[selectbox] )

View File

@ -1180,7 +1180,7 @@ export class et2_selectbox extends et2_inputWidget
if(name_parts.length > 1 && (!content_options || content_options.length == 0 )) if(name_parts.length > 1 && (!content_options || content_options.length == 0 ))
{ {
var pop_that = jQuery.extend([],name_parts); 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(); var last = pop_that.pop();
content_options = widget.getArrayMgr('sel_options').getEntry(pop_that.join('[')); content_options = widget.getArrayMgr('sel_options').getEntry(pop_that.join('['));