Contextmenu on datatable header

hi there,
i would like to attach a contextmenu (right-click) to a datatable header. Is that possible and if so, how di i do that?
Additionally (on another table) i want to have a popup opening when right-clicking. Is that also possible and how?
Thanks, Marc

Pro version contains a header menu.

But basically, the datatable header supports only left mouse click event (onHeaderClick()).

http://webix.com/snippet/c3bc41a1

The problem with the left-click is that it collides with the sorting left click.

I have seen the header menu of the Pro version, but its not customizable enough for me. i would like to put more complex settings into that menu than just hide/show of columns.
Is it possible to replace the content of the header menu with my own content?

Not exactly. The left-click sorting is a part of autoConfig:true.

Unfortunately, the header menu will trigger hide/showColumn events on every click.

You can create a custom click handler as shown below:

http://webix.com/snippet/4b676653

Note that it requires disabling of the native browser right-click handler within the datatable layout. Despite of it, all Webix context items will work.

Hi Listopad,
Thanks for your answer. I am still trying to figure out the best way for our configuration menu. As i am not entirely happy with the right-click (not obvious enough) i am looking towards a left-click on an (fontawesome) icon in the header, which i term opens a pop (that might contain a menu or something that has yet to be defined).
Something along the lines of this, but i don’t know how to link the left click on the icon to the popup. Probably a jquery click listener would do the trick, but i don’t know how to position the popup at where the icon is (unless with very preciese coordinates). I assume there is some way to do this in webix that i have not found yet.
http://webix.com/snippet/a57d48c7
Can you help me out here, please?
Thanks, Marc

If possible i would like to keep the fontawesome icon using the

<i id="settings" class="fa fa-cog"></i>

as those can be created and styled by our application code.

You can check whether your click target has the right class or not:

http://webix.com/snippet/5b3edc01

That works. Thanks.
Currently the menu/popup is slightly offset to the right (the little arrow on top indicating the source of the opening). Is there a way to fix that?

The show() method has some positioning options. But you can use e.target (which is related to the icon) instead of e (related to the mouse click):

http://webix.com/snippet/c9d105f8

Thanks!