Update breaks icarus sub menu
Posted: 15 Nov 2016, 12:05
I have a problem with icarus template menu
Whenever i try to update element around icarus menu (form) it removes events on sub menus, so they cannot be closed or opened.
example code. After pressing test button menu stops working.
I fixed it by changing layout.js bindEvents to
I know its not the right way to fix it, but this is working for me, at least for now.
Whenever i try to update element around icarus menu (form) it removes events on sub menus, so they cannot be closed or opened.
example code. After pressing test button menu stops working.
Code: Select all
<h:form id="menuform">
<pi:menu widgetVar="appMenu">
<p:submenu label="Tasks" icon="fa fa-tasks" >
<p:menuitem value="Active" icon="fa fa-tasks" />
</p:submenu>
</pi:menu>
<p:commandButton value="test" update="menuform"></p:commandButton>
</h:form>
Code: Select all
bindEvents: function() {
var $this = this;
this.sidebarNav.nanoScroller({flash: true});
this.slimToggleButton.on('click', function(e) {
$this.toggleMenu();
e.preventDefault();
});
//TODO find a better way to allow update
this.menulinks = $('a.menuLink');
this.menulinks.on('click',function(e) {
...............