Fix chosen going crazy in filters by removing unwanted 'No fields' label.

Every selectbox (chosen) was binding to the one label, so any click in that area tried to open them all
This commit is contained in:
Nathan Gray 2014-07-08 17:35:14 +00:00
parent 15926a315f
commit d10dd0b6ed

View File

@ -48,8 +48,6 @@ class importexport_widget_filter extends etemplate_widget_transformer
unset($value['fields']);
$relative_dates = $this->attrs['relative_dates'];
$this->setElementAttribute($form_name, 'prefix', self::$prefix);
// Fallback, so there's something there...
if(!is_array($fields))
{
@ -60,6 +58,12 @@ class importexport_widget_filter extends etemplate_widget_transformer
);
return parent::beforeSendToClient($cname);
}
// Need to clear this if it's not needed. It causes Chosen selectboxes
// to bind to this label.
self::$transformation['label'] = '';
$this->setElementAttribute($form_name, 'prefix', self::$prefix);
$n = 1;
foreach($fields as $lname => &$field)
@ -138,7 +142,7 @@ class importexport_widget_filter extends etemplate_widget_transformer
}
else
{
error_log('Trying to filter with unsupported field type: ' . $field['type']);
error_log('Trying to filter with unsupported field type: ' . $field['type']);
}
}