Property functions vs Events: What am I missing

Ok, so I'm making my way to understanding Webix. For example, I have a basic form:

But here's what I'm finding. Some events, like "click", are properties you pass in anonymous functions to, which seems to work well. But others, like the forms' onsubmit, don't seem to work that way; they have to be bound separately in a somewhat clunky way. (Eg, on the example above, the onsubmit property doesn't work!)

Am I missing something? Is there a consistent way of handling events with webix?


  • Hi,

    It's a question of syntax. If you define events within component's configuration, you need to declare them in on:{ } property:

    In the same time, there are specific event handlers for common purposes: click (for inputs) and ready (for data components). Please check also the related article in the documentation.

  • Thanks, Listopad. Is it fair to say then that the click handler is something of a shortcut for on: {onClick: ...}?

  • edited May 2017

    To be precise, for controls (text, button, etc.) it is similar to

    on:{ onItemClick: /**/ }

    onClick is also a specific property (outsideon object) for data components, which allows setting separate click handlers to particular CSS classes, for example:

        template:"#title# <span class='info'>Click for details</span>",
            'info':function(event, itemId){ /**/ }
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!