0
試圖創建一個自定義Webix觀點,但我不能讓click
事件:如何啓用自定義組件中的點擊事件?
這裏是我的嘗試:http://webix.com/snippet/dbab5734
webix.protoUI({
name:"testView",
$init:function(config)
{
this.$view.innerHTML = '<span class="webix_icon fa-question-circle" style="font-size:50px; margin:10px;"></span>';
},
defaults:
{
value: "",
height:60,
width:60
},
on_click:{
webix_view:function(){
alert();
}
},
setValue:function(value){
console.log(value);
},
getValue:function(){
return this.config.value
}
}, webix.ui.view, webix.EventSystem);
好像webix.EventSystem
是不夠的,但我想不通的地方是我的錯誤,因爲on_click
處理程序在其他情況下正常工作