Added a basic click handler to the buttons.
This commit is contained in:
parent
79d32757b9
commit
361d803139
@ -26,13 +26,20 @@ class View {
|
||||
this.$sidebar = $("#sidebar", page);
|
||||
}
|
||||
|
||||
handleClick() {
|
||||
frappe.msgprint("Button Clicked");
|
||||
}
|
||||
|
||||
set_sidebar_categories(categories) {
|
||||
$.each(categories, (index) => {
|
||||
const $button = $(`<button>${categories[index]}</button>`);
|
||||
$button.addClass("sidebar-button");
|
||||
$button.on('click', this.handleClick);
|
||||
//$button.addEventListener('click', this.handleClick)
|
||||
this.$sidebar.append($button);
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Controller {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user