Set current column filter values

This commit is contained in:
Nathan Gray 2011-09-27 23:16:54 +00:00
parent 36c39cf4b8
commit a1d344077e
2 changed files with 12 additions and 3 deletions

View File

@ -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]);
}
}
});

View File

@ -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);
}
});