diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index 9c9dcc67e5..d4b5fc3f09 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -749,6 +749,12 @@ var et2_nextmatch_filterheader = et2_selectbox.extend(et2_INextmatchHeader, { */ setNextmatch: function(_nextmatch) { this.nextmatch = _nextmatch; + + // Set current filter value from nextmatch settings + if(this.nextmatch.options.settings.col_filter && this.nextmatch.options.settings.col_filter[this.id]) + { + this.set_value(this.nextmatch.options.settings.col_filter[this.id]); + } } }); diff --git a/etemplate/js/et2_widget_selectbox.js b/etemplate/js/et2_widget_selectbox.js index 604cbd2391..a4778d4476 100644 --- a/etemplate/js/et2_widget_selectbox.js +++ b/etemplate/js/et2_widget_selectbox.js @@ -150,10 +150,11 @@ var et2_selectbox = et2_inputWidget.extend({ set_value: function(_value) { jQuery("option",this.input).attr("selected", false); - this.value = null; - if(jQuery("option[value='"+_value+"']", this.input).attr("selected", true).length > 0) + this.value = _value; + if(jQuery("option[value='"+_value+"']", this.input).attr("selected", true).length == 0) { - this.value = _value; + et2_debug("warning", "Tried to set value that isn't an option", this, _value); +//console.trace(); } }, @@ -180,6 +181,8 @@ var et2_selectbox = et2_inputWidget.extend({ this._appendOptionElement(key, _options[key]); } } + // Sometimes value gets set before options + if(this.value) this.set_value(this.value); } });