- renders a field with details of a related record. Expanding the field displays a popup list to search large amounts of records. Supported by singular relationships only.
-呈现包含相关记录详细信息的字段。展开字段会显示一个弹出列表以搜索大量记录。仅受单一关系支持。
可以以某一列表记录的字段作为表单的值
文档案例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
user: label: User type: recordfinder list: ~/plugins/rainlab/user/models/user/columns.yaml recordsPerPage: 10 title: Find Record prompt: Click the Find button to find a user keyFrom: id nameFrom: name descriptionFrom: email conditions: email = "bob@example.com" scope: whereActive searchMode: all searchScope: searchUsers useRelation: false modelClass: RainLab\User\Models\User
useRelation Flag for using the name of the field as a relation name to interact with directly on the parent model. Default: true. Disable to return just the selected model's ID modelClass Class of the model to use for listing records when useRelation = false
Option Description action defines the action applied to this field when the condition is met. Supported values: show, hide, enable, disable, empty. field defines the other field name that will trigger the action. Normally the field name refers to a field in the same level form. For example, if this field is in a repeater widget, only fields in that same repeater widget will be checked. However, if the field name is preceded by a caret symbol ^ like: ^parent_field, it will refer to a repeater widget or form one level higher than the field itself. Additionally, if more than one caret ^ is used, it will refer that many levels higher: ^^grand_parent_field, ^^^grand_grand_parent_field, etc. condition determines the condition the specified field should satisfy for the condition to be considered "true". Supported values: checked, unchecked, value[somevalue].
我的理解
当 field 这个字段 达到某种条件或值 也就是 condition 时 ,对应的这个字段将做 action 这样的动作; 如果 action 设成 show 的话,默认是不显示的。