Page 1 of 2

[INFO REQ] OnToggle in the CheckColumn not working

Posted: Fri May 20, 2022 8:21 pm
by henrique

In the code below, when I click the checkbox column, the "onToggle", or "onBeforeToggle" or "onToggleAll" event is not triggered.

// grid with CheckColumn
let grid = new Grid({
    appendTo   : document.body,
    // makes grid as high as it needs to be to fit rows
    autoHeight : true,
    data       : DataGenerator.generateData(5),
    columns    : [
        { field : 'name', text : 'Name', flex : 1 },
        { type : 'check', field : 'done', text : 'CheckColumn', showCheckAll: true, flex : 1, align : 'center', 
         onToggle: () => Toast.show('onToggle clicked'), onBeforeToggle: () => Toast.show('onBeforeToggle clicked'), onToggleAll: () => Toast.show('onToggleAll clicked') }
    ]
});

// Text only
new Button({
    appendTo   : document.body,
    text     : 'Text only',
    onClick: () => Toast.show('Button clicked')
});

Re: [INFO REQ] OnToggle in the CheckColumn not working

Posted: Fri May 20, 2022 8:29 pm
by mats

'onXXX' functions aren't called by default, add https://bryntum.com/docs/grid/api/Core/mixin/Events#config-callOnFunctions to true on your column and it'll work.


Re: [INFO REQ] OnToggle in the CheckColumn not working

Posted: Fri May 20, 2022 9:02 pm
by henrique

Changed, but still not working for me.

// grid with CheckColumn
let grid = new Grid({
    appendTo   : document.body,
    // makes grid as high as it needs to be to fit rows
    autoHeight : true,
    data       : DataGenerator.generateData(5),
    columns    : [
        { field : 'name', text : 'Name', flex : 1 },
        { type : 'check', field : 'done', flex : 1, align : 'center', text : 'CheckColumn', showCheckAll: true, 
          callOnFunctions : true, 
          onToggle: () => Toast.show('onToggle clicked'),
          onBeforeToggle: () => Toast.show('onBeforeToggle clicked'), 
          onToggleAll: () => Toast.show('onToggleAll clicked') }
    ]
});

// Text only
new Button({
    appendTo   : document.body,
    text     : 'Text only',
    onClick: () => Toast.show('Button clicked')
});

Re: [INFO REQ] OnToggle in the CheckColumn not working

Posted: Fri May 20, 2022 9:37 pm
by mats

Right, seems that's a minor bug - we'll look into that. Please use the listeners notation instead:

columns    : [
        { field : 'name', text : 'Name', flex : 1 },
        { type : 'check', field : 'done', flex : 1, align : 'center', text : 'CheckColumn', showCheckAll: true, 
          listeners : {
          toggle: () => Toast.show('onToggle clicked'),
          beforeToggle: () => Toast.show('onBeforeToggle clicked'), 
          toggleAll: () => Toast.show('onToggleAll clicked') }
          }
    ]

Re: [INFO REQ] OnToggle in the CheckColumn not working

Posted: Fri May 20, 2022 9:40 pm
by henrique

I will wait for the fix. Thanks for the reply!


Re: [INFO REQ] OnToggle in the CheckColumn not working

Posted: Mon May 23, 2022 1:29 pm
by henrique

Re: [INFO REQ] OnToggle in the CheckColumn not working

Posted: Thu Aug 04, 2022 2:05 pm
by henrique

Any news about this bug?


Re: [INFO REQ] OnToggle in the CheckColumn not working

Posted: Thu Aug 04, 2022 2:50 pm
by tasnim

Hi,
We'll consider it for 5.2.x patch release.

Good Luck :),
Tasnim


Re: [INFO REQ] OnToggle in the CheckColumn not working

Posted: Mon Aug 29, 2022 2:23 pm
by henrique

This still not working...


Re: [INFO REQ] OnToggle in the CheckColumn not working

Posted: Mon Aug 29, 2022 2:54 pm
by mats

It works in 5.1.2, which version did you test?