【问题标题】: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