Hi,
I have (after defining the Active List Prototype) two buttons in the list (delete and edit) and I want to add a ClickButtonEvent using webix jet.
When I add under
return {
$ui: taskformcomment,
$oninit: function (viewtasks) {
$$(‘delbutton_comment’).attachEvent(“onItemClick”, function(id, e){
var item_id = $$(‘list_comments’).locate(e);
alert(item_id);
//returns id of a list item
})
};
I got the error message: “Cannot read property ‘attachEvent’ of undefined”
How can I reference to the active content buttons?
Thanks!
My ui is:
var taskformcomment = {
{
view: “activeEditList”,
id: “list_comments”,
css: “list_comments”,
minHeight: 600,
scroll: “y”,
“template”: function (obj, common) {
var format = webix.Date.dateToStr("%d.%m.%Y %H:%i");
var html = “
html += “
html += “
html += “
return html;
},
“type”: {
“height”: “auto”
},
select: true,
navigation: true,
activeContent: {
editButton: {
id: “editbutton_comment”,
name: “editbutton_comment”,
view: “button”,
type: ‘icon’,
icon: ‘edit’,
width: 40,
height: 40
},
deleteButton: {
id: “delbutton_comment”,
name: “delbutton_comment”,
view: “button”,
type: ‘icon’,
icon: ‘remove’,
width: 40,
height: 40
}
}
}
}