1
看完这个(和其他人......)对文档的文章(link)我找不到从我身边的一个问题...OctoberCMS:触发事件不起作用
我不能把扳机事件的工作......因此,这里是我的代码:
//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]
// galleryplusvideoselect _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>
我tryed创建一个简单的复选框和文本区域和创建触发器的功能中继之外......但它不是工作...我无法找到任何类型的JS的“激活“所以我不知道我能做些什么来把这个工作...