sheet change event for checkbox

Community Driven Extensions Project
Post Reply
bug007
Posts: 39
Joined: 07 Oct 2015, 12:08

26 Jul 2018, 11:20

Hi,
version 6.2.7
Ajax 'change' event is seem to call when the cell lost focus.
When it'is on a colType="checkbox" I would like that the "change" event occur when the click is done.
Why, because if you click twice, you return to the previous state, but it is not true on pe:sheetcolumn. If you click a lot of checkbox, only one is update ...

Test it on the show case :
- click one time on a checkbox => your check box change but no update message
- click a second time on the same checkbox => your check box change, the update message appear one row update, and your check box change another time :(

Another test , same show case to update few checkbox one by one :
- click one checkbox => your check box change but no update message
- click another check box => your new check box change, the update message appear one row update (it is the last check box = good)
- click another check box => your new check box change, the update message appear No row update (the previous change it's do :( )
- click another ....
==> only the first checkchange is done :shock:


How user made to be sure the change will be done with the correct value ?
Is it a way to do change when click checkbox ? Or is it a bug ?

Thanks for your help

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

26 Jul 2018, 13:34

So the Ajax 'change' event fires when you leave a cell. Because when editing a cell you really haven't done anything until you leave the cell..

Code: Select all

afterDeselect: function () {
                if ($this.updated) {
                    $this.updated = false;
                    if ($this.hasBehavior('change')) {
                        $this.cfg.behaviors['change'].call(this, 'change');
                    }
                }
},
For most cases this makes perfect sense because the validation of cell should only occur when you are done editing a cell.

However that being said i see what you mean, if you click a checkbox in the showcase it says "0 Rows Changes". So the checkbox behavior must be modified. I would say report it as a bug on GitHub!
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

bug007
Posts: 39
Joined: 07 Oct 2015, 12:08

26 Jul 2018, 15:22

OK, there is : https://github.com/primefaces-extension ... issues/599

I suggest also on the issue to make the correction for dropdown type because the validation it's not necessary too ?
What do you think about ?

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

26 Jul 2018, 15:39

I will investigate. The sheet is quite complex so I am hestitant to change many things to fix one issue that could break others. I will see what I can do.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

03 Aug 2018, 13:23

I submitted a fix if you don't mind testing it out?
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests