銀色條紋顯示邏輯在CMS中的表單上完美工作,但我無法讓它在前端的表單上工作,特別是Bootstrap表單。用於前端/引導形式的銀條紋顯示邏輯
它會隱藏該元素,但在應用邏輯時不會顯示它。
//If the wetsuit dropdown is equal to custom then show the fins numerical field.
DisplayLogicWrapper::create(NumericField::create("Fins","Fins"))->displayIf("Wetsuit")->isEqualTo('Custom')->end(),
我看到它只是需要顯示從無更改爲塊。 有沒有辦法做到這一點,以便它將保持頁面重新加載的狀態?下拉值將被保存爲數據庫條目。
編輯:這在CMS的作品,但不在前端工作 - Custom
是枚舉值的一部分。
DropdownField::create("Wetsuit","Wetsuit")
->setSource(singleton('DiveEquipment')->dbObject('Wetsuit')->enumValues())
->setEmptyString('Select one'),
NumericField::create('Fins','Fins')
->displayIf('Wetsuit')
->isEqualTo('Custom')
->end(),
EDIT2:與SilversTripe 3.5工作,引導窗體1.20和顯示邏輯1.0.8
1.0.8是非常過時,但。
因此,如果您將'Wetsuit'下拉值更改爲'Custom',那麼Fins'字段不會顯示?你是否證實實際的下拉值包含'Custom'?也許你需要發佈你的Dropdown創建代碼。 – bummzack
這是正確的。它將顯示在CMS中,但不在前端。該值確實包含「Custom」。 我看到在前端有JS錯誤。將更新OP。 – Craig
我想你需要包括entwine ... – bummzack