Page 1 of 1

[VUE] bind the element of the column with an event using jquery

Posted: Thu Jan 14, 2021 10:29 pm
by c.amine

I have a column with checkboxes which I create using the render option

I want to bind the checkboxes with events using JQuery but when I scroll the component keep rendering the rows so I lose the connection between the event and the element!

Is there an easy way to create custom items inside columns and link them with an event listener?


Re: [VUE] bind the element of the column with an event using jquery

Posted: Fri Jan 15, 2021 12:12 pm
by mats

Why use jQuery for this? Just use event delegation listen to a parent element once. https://dmitripavlutin.com/javascript-event-delegation/


Re: [VUE] bind the element of the column with an event using jquery

Posted: Fri Jan 15, 2021 1:21 pm
by c.amine

i still have a problem with checkboxes ... after I scroll the checkboxes are rendered again so they are no more checked !!


Re: [VUE] bind the element of the column with an event using jquery

Posted: Fri Jan 15, 2021 1:24 pm
by pmiklashevich

We could not reproduce this issue. To assist you with your question, please provide more details including a runnable test case (as described in our support guidelines).

To get the fastest possible support, provide a simple test case based on our standard examples.


Re: [VUE] bind the element of the column with an event using jquery

Posted: Fri Jan 15, 2021 1:27 pm
by pmiklashevich

If you need checkbox row selection you can configure selectionMode.

Also there is a CheckColumn. Please check out the docs: https://www.bryntum.com/docs/gantt/#Grid/column/CheckColumn


Re: [VUE] bind the element of the column with an event using jquery

Posted: Fri Jan 15, 2021 1:49 pm
by Animal
c.amine wrote: Fri Jan 15, 2021 1:21 pm

i still have a problem with checkboxes ... after I scroll the checkboxes are rendered again so they are no more checked !!

Unless the checked column is linked to a boolean field in the underlying data, then what application state are you changing when checking a checkbox in a column?

Go to https://www.bryntum.com/examples/grid/bigdataset/ and type the following into the debugger:

grid.columns.add({ type : 'check', field : 'done', text : 'Done' });

That is linked to the "done" boolean field in the underlying data.