Make sure options get set, if provided to constructor

This commit is contained in:
Nathan Gray 2012-05-23 23:54:30 +00:00
parent 9d11043ef3
commit fc3553636d

View File

@ -515,6 +515,7 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM], {
this.supportedWidgetClasses = []; this.supportedWidgetClasses = [];
this.optionValues = {}; this.optionValues = {};
if(this.options.select_options) this.set_select_options(this.options.select_options);
}, },
createInputWidget: function() { createInputWidget: function() {
@ -577,7 +578,7 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM], {
return; return;
} }
var option = this.optionValues[_value]; var option = this.optionValues[_value];
if (typeof option === 'object') if (typeof option === 'object' && option != null)
{ {
this.span.text(option.label); this.span.text(option.label);
this.set_statustext(option.title); this.set_statustext(option.title);