在阅读有关文档的这篇(和其他......)文章(链接)后,我找不到我身边的问题......
我不能让触发事件工作......所以这是我的代码:
//fields.yaml
fields:
gallery:
label: Galeria
span: full
oc.commentPosition: ''
prompt: 'Add new item'
type: repeater
form:
fields:
type:
label: 'Select the type of a gallery item'
span: full
type: galleryplusvideoselect
galleryplusvideo:
label: Gallery
span: full
oc.commentPosition: ''
type: galleryplusvideo
hidden: true
trigger:
action: show
field: type
condition: value[image]
//图库加视频选择_widget.htm
文件
<div data-control="balloon-selector" class="control-balloon-selector">
<ul>
<li data-value="image" <?php if($type == "image") echo 'class="active"'; ?>>Image</li>
<li data-value="video" <?php if($type == "video") echo 'class="active"'; ?>>Video</li>
</ul>
<input type="text" onkeyup="
$(this).trigger('change')" <!-- <--- THIS IS ONLY TO REPRODUCE AN EXAMPLE FROM THE DOCUMENTATION -->
name="<?=$name ?>" value="<?= $type ?>" />
</div>
我尝试创建一个简单的复选框和文本区域,并在中继器之外创建触发功能......但它不起作用......我找不到任何类型的 JS“激活”,所以我不知道我可以做这个工作......