Trigger webix component from HTML link

edited October 12 in Technical questions

I'm just wondering if there is a way to trigger a Webix component that is wrapped inside ui.template?

For instance: {template:"<\div> Agree to <\a href="{common.deleteButton()}"> terms</\a> </\div>"}

From a previous example i found: https://webix.com/snippet/0bbf08bb

In this example, rather than activating javascript.alert(), is there a way to activate a webix component?

Tagged:

Comments

  • We would rather recommend using the HTML templates where it's possible.

    For example, a template can have the same CSS as a regular button:
    https://webix.com/snippet/d933c5d4

    There's also a possibility to set an active content to get a full-featured form input (ui.text, ui.button, ui.richselect, etc) and set any action on the component's click event handler (or any event you need). As a sample, please check https://webix.com/snippet/12c828b5

  • This was helpful and I figured out a roundabout way of doing it, but I'd like to use the ui.checkbox. I've tried using on_click (as it looks to be part of ui.checkbox), but it isn't working: https://webix.com/snippet/631af622

  • edited October 16

    Can you please clarify, do you want to use ui.checkbox as a separate control or as an active element of a data component (as links/icons in the first samples)?

    Initialization and event handling are a bit different in these use-cases.

    Here's the corrected sample from the last message:

    https://webix.com/snippet/97a156e0

    Data components (datatable, list, tree, treetable) has the predefined onClick event.
    In all other components, onClick has to be declared in components configuration as an empty object for proper initialization, then the on_click can be set.

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!