Hi, I am using display logic module for SS https://github.com/unclecheese/silverstripe-display-logic
it work good but has one problem it not worting with file upload fields. Does anybody face this?
From firebug it seams that js ignoring file upload input container, I tryied different variations from simple displayif, to putting all in LogicWrapper same results with file upload fields.
Here is my basic code:
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields = new FieldList(
DropdownField::create('ProductID', 'Product', Product::get()->map('ID', 'Title'))->setEmptyString('(Select one)'),
$mainCategory = DropdownField::create('CategoryID', 'Category', Category::get()->map('ID', 'Title'))->setEmptyString('(Select one)'),
$mainLocation = DropdownField::create('LocationID', 'Location', Location::get()->map('ID', 'Title'))->setEmptyString('(Select one)'),
$mainTitle = TextField::create('Title', 'Title'),
$mainFile = UploadField::create('File', 'File')->setFolderName('Uploads/Files')->setAllowedExtensions(array('odt', 'jpg', 'jpeg', 'png', 'gif', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pdf')),
$addMoreDocSwicher = CheckboxField::create('HaveChild', 'I want to upload additional document'),
// second fields hidden
$secondaryDocument_category = DropdownField::create('CategoryID2', 'Category', Category::get()->map('ID', 'Title'))->setEmptyString('(Select one)'),
$secondaryDocument_location = DropdownField::create('LocationID2', 'Location', Location::get()->map('ID', 'Title'))->setEmptyString('(Select one)'),
$secondaryDocument_files = UploadField::create('File2', 'File'),
$secondaryDocument_title = TextField::create('Title2', 'Title')
);
$mainCategory->displayIf("ProductID")->isNotEqualTo("");
$mainLocation->displayIf("ProductID")->isNotEqualTo("")->andIf("ProductID")->isNotEqualTo(3);
$mainTitle->displayIf("ProductID")->isNotEqualTo("");
$mainFile->displayIf("ProductID")->isNotEqualTo("");
$addMoreDocSwicher->displayIf("ProductID")->isEqualTo(5)->orIf("ProductID")->isEqualTo(6);
$secondaryDocument_category->displayIf('HaveChild')->isChecked();
$secondaryDocument_location->displayIf('HaveChild')->isChecked();
$secondaryDocument_title->displayIf('HaveChild')->isChecked();
$secondaryDocument_files->displayIf('HaveChild')->isChecked();
return $fields;
}
Any ideas? Thanks.