【问题标题】:How to enable more options for a DropDown Field in Silverstripe如何在 Silverstripe 中为下拉字段启用更多选项
【发布时间】:2020-11-19 18:27:01
【问题描述】:

我有一个 SilverStripe DropDown 字段,带有 CountryID:

DropDownField::create('CountryID', 'Country', Country::get()->map('ID', 'Name')->toArray())

该字段未显示下拉菜单,而是显示一个输入字段,其中包含 ID 和文本:“相关对象过多;正在使用后备字段”

如何禁止回退发生。例如,我可以将相关对象的最大数量设置为更大的数字,比如 300?

【问题讨论】:

    标签: silverstripe


    【解决方案1】:

    可以这样设置:

    // mysite.yml
    
    SilverStripe\ORM\FieldType\DBForeignKey:
      dropdown_field_threshold: 300  
    

    【讨论】:

    • 很好地解决了您的问题并发布了答案。您想将此标记为已接受的答案吗?谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-07
    • 2023-01-21
    • 2019-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多