I extend a component from webix.ui.list , but item click event did not work .
Code like that :
webix.protoUI({
name:"menulist",
defaults:{
css:"menu",
select:"multiselect",
type:{
height: 'auto'
}
},
type:
{
templateStart: function(obj, common, marks)
{
return "<div>";
},
template: function(obj, common, marks)
{
if('header' in obj)
{
return "<div class='menu-header'>"+obj.text+"</div>";
}else if('footer' in obj)
{
return "<div class='menu-footer'>"+obj.text+"</div>";
}else{
return '<div class="menu-'+obj.color+'">'+obj.text+'<span class="put-right">'+common.itemIcon+'</span></div>';
}
},
templateEnd: function(obj, common, marks)
{
return "</div>";
},
itemIcon:"<i class='fa fa-plus-square-o'></i>"
},
on_click: {
webix_list_item: function(e,id){
console.log(e);
}
}
} , webix.ui.list );
Can you give me some advise ?
btw, I found an error on the document page:
http://docs.webix.com/kanban__events.html#onlistitemclick:
onListItemClick
fires on an item click
$$("myBoard").attachEvent("onListIconClick", function(itemId,ev,node,list)){
// your code
};
false spell : “onListIconClick”