Our blazing fast Grid component built with pure JavaScript


Post by Webethics »

Hello

I have checked the below tutorial.
https://www.bryntum.com/examples/grid/renderers/

But I try to implement this thing in Vue js. The button is rendered but not able to get the click event of the button. Can you please guide me on how can I achieve this?

Thanks


Post by pmiklashevich »

If you're talking about the button added to the column header, this is a regular html Button element.

    columns : [
        {
            text           : 'Name',
            field          : 'name',
            flex           : 1,
            cellCls        : 'name',
            headerRenderer : ({ record }) => {
                return `<label>Name</label><button class="addnew b-blue b-raised b-button">ADD</button> `;
            }
        },

You can add a handler using onclick event:

<button onclick="handler">Click me</button>

or add a listener from javascript:

button.addEventListener("click", handler);

Pavlo Miklashevych
Sr. Frontend Developer


Post by Webethics »

It worked for me. Thanks for your support.


Post Reply