Use select account filter nextmatch header for custom filters of type 'select-account'

This commit is contained in:
Nathan Gray 2015-12-04 19:24:49 +00:00
parent ecd1ad3628
commit 59d1f23bb0

View File

@ -2930,18 +2930,21 @@ var et2_nextmatch_customfields = et2_customfields_list.extend(et2_INextmatchHead
// Create widget by type
var widget = null;
if(field.type == 'select')
if(field.type == 'select' || field.type == 'select-account')
{
if(field.values && typeof field.values[''] !== 'undefined')
{
delete(field.values['']);
}
widget = et2_createWidget("nextmatch-filterheader", {
id: cf_id,
empty_label: field.label,
select_options: field.values
}, this);
widget = et2_createWidget(
field.type == 'select-account' ? 'nextmatch-accountfilter' : "nextmatch-filterheader",
{
id: cf_id,
empty_label: field.label,
select_options: field.values
},
this
);
}
else if (apps[field.type])
{
@ -3209,12 +3212,6 @@ var et2_nextmatch_accountfilterheader = et2_selectAccount.extend([et2_INextmatch
},
set_select_options: function(_options) {
// Tell framework to ignore, or it will reset it to ''/empty when it does loadingFinished()
this.attributes.select_options.ignore = true;
this._super.apply(this, arguments);
},
/**
* Set nextmatch is the function which has to be implemented for the
* et2_INextmatchHeader interface.