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的「激活「所以我不知道我能做些什麼來把這個工作...