【问题标题】:OctoberCMS | Paste relation attibute into a hidden input十月CMS |将关系属性粘贴到隐藏的输入中
【发布时间】:2017-10-11 15:36:17
【问题描述】:

假设我有一个关系字段,并且我想将该关系以及一个所选关系的属性name 存储到隐藏输入中。

示例:在一个关系字段中我选择了一个带有name“Something Cool”的项目,我想将“Something Cool”存储到隐藏输入info中。

我该怎么做?

(我需要那个因为排序...我无法访问关系)

【问题讨论】:

    标签: octobercms octobercms-backend octobercms-plugins october-form-controller


    【解决方案1】:

    您可以使用该字段的dependsOn 选项来设置here 描述的值:

    project_id:
        label: Projecto
        type: relation
        nameFrom: name
    sorting_field:
        type: text
        dependsOn: project_id
        cssClass: hidden # this is a helper class from storm.css to set the visibility to hidden
    

    fitlerFields()函数中设置值here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-02
      • 1970-01-01
      • 2019-09-27
      • 2019-01-31
      • 1970-01-01
      • 1970-01-01
      • 2014-08-31
      • 1970-01-01
      相关资源
      最近更新 更多