fixing combo/select boxes on Matrix search and edit listing screens

This commit is contained in:
Yung Han Khoe 2009-02-27 14:17:09 +00:00
parent 2cabca66e9
commit 45a724f761
2 changed files with 17 additions and 4 deletions

View file

@ -313,6 +313,14 @@ sub getEditForm {
$attribute->{label} = $attribute->{name};
$attribute->{subtext} = $attribute->{description};
$attribute->{name} = 'attribute_'.$attribute->{attributeId};
if($attribute->{fieldType} eq 'Combo'){
my %options;
tie %options, 'Tie::IxHash';
%options = $db->buildHash("select value, value from MatrixListing_attribute
where attributeId = ? and value != '' order by value",[$attribute->{attributeId}]);
$attribute->{options} = \%options;
$attribute->{extras} = "style='width:120px'";
}
$form->dynamicField(%{$attribute});
}
}