Our blazing fast Grid component built with pure JavaScript


Post by henrique »

Hi!

I need fill the on click event in a label component but doesn't work only filling the config. I'm trying to put a hamburger button, but became very ugly, so I'm using the label instead.

Any suggestions?


Post by tasnim »

Hi,

There is no built-in event available for the Label component. But you could add a native JS click event listener
Just add a ref to make it easier to select

// Simple label element
new Label({
    appendTo : document.body,
    text     : 'Simple label',
    ref      : 'label1'
});

document.querySelector('[data-ref="label1"]').addEventListener('click', () => {
  console.log('click');
});

Hope this helps.

Please let us know if you have any other questions 🙂

Best regards,
Tasnim


Post by henrique »

Is this a possibility to allow this event to work in the label component?


Post by marcio »

Hey,

We'll discuss with the team, but I created a ticket for that here https://github.com/bryntum/support/issues/8358

Best regards,
Márcio


Post Reply