Sidebar Toggled (Iconview)

Hello,
when my sidebar is toggled to icon view only, I will get an event to the icons, but not to the text, according to the icon, that will pop up. But for items with populist it will work with attached event for them. This is unhandy, any idea how to add the onClick event also to the pop up text for icons?

Hello,
Please, could you illustrate the issue?

I have the Same issue.
When the sidebar is collapsed, the on click event only fires then we click on the icon not the popup, is there a way to have it fire when I click on any of them the popup or the icon?

Hello @MPaul,
Maybe the snippet helps you https://snippet.webix.com/onasjg65

when I try it I get this error.
$$(…).getPopupList is not a function.
the only difference I see is that I don’t use data I load dynamically using load url.

@Nastja
Can you help me please.

@MPaul

Sorry for the inconvenience, getPopupList method was deprecated in Webix 5.2. Since that version Sidebar

  • supports multilevel data,
  • was included in the library (there is no need to attach additional JS files).

By default, only select-related events are assigned from popup menu to the parent sidebar.

Assuming you are using the 5.2+ version, please note that the popup contains the complex structure, so any other event has to be attached as follows:

sidebar.getPopup().queryView({view:"menu"}).attachEvent(" ... ", function(id){ /* ... */ });

In order to track click events on all menu levels, please use onMenuItemClick instead of onItemClick.

@Listopad
Thank you but I am getting an error in the snippet
https://snippet.webix.com/ova04h34
I also tried it in my code it worked but it doesn’t work when I click on the header inside the popup.
ex:
var menu_data = [
{“id”: “player”, icon: “user”, value: “Player”, data: [
{ id: “search”, value: “Search”, page: “search”},
{ id: “account”, value: “Account”, page: “account”},
{ id: “experiment”, value: “Experiments”}
]},
{“id”: “system”, icon: “gear”, value: “System”}
];
if I click on the popup for “system” while the side bar is collapsed it doesn’t work; “the popup not the icon”.

@MPaul please check: https://snippet.webix.com/bq3g3oci

Since view:"sidebar" is included in the Webix library, there is no need to include additional sidebar.js (required only for 5.1 and earlier).
This file included in the snippet with the latest Webix version will cause a conflict of API, i.e. old getPopupList will work, while the actual methods for retrieving a popup will fail.

@Listopad
can you please check this snippet out.
https://snippet.webix.com/wjhr3fmd
if you click on the book popup it will not call the click event.

@Listopad

is there a solution for this?

@MPaul click events on the top panel of popup menu is not intended by design. In order to the popup structure, it is just a title (ui.template) above the menu.
But as a solution, you can rewrite the inner click handler and add a call event in addition to the default selection processing:

https://snippet.webix.com/htaob5ja

As a side note - there is an issue with selection highlighting, which will be fixed in the next version.

Thanks @Listopad
Your the best.