ptotoUI and onItemClick

Hello! I tried to create my own view with mouse event handling.

    name: "mapStatusLine",
    defaults: {
        template: "…",  
        on: {
            'onItemClick': function () { }
    // custom stuff
}, webix.ui.template, webix.MouseEvents);

And the 'onItemClick' fires never. Why so? What am I doing wrong?


  • edited May 2018


    You need to specify a click target as a CSS class of the needed HTML element. You can do it within the on_click property of the custom widget:

             this.callEvent("onItemClick", [e]);

  • edited May 2018

    you should not define event handlers in defaults block.
    as it will not work if you add any handler in view config.
    instead you should add required event handler in $init.

       $init: function(config) {
          this.attachEvent("onItemClick", function(){
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion