On change for the whole collection of input fields in a grid

Hi everyone,

I can set an event receiver on an input field, i.e.

fd.field('Knowledge').$on('change', function (value) {
    if (value) {
      calculateTotal(value);
    }
  })

but is it also possible to set an event receiver on a grid-element?

What I want to achieve: if a value of one of the input fields in a grid is changed, do something.
Now I have to enumerate all the fields individual. It would be more fool-proof if I just could say: if any of the elements of my named grid is changed, run a certain function

Can this be done? How?

Kind regards,
Bart

Hello @bartplessers,

Please see the code sample in the Disable all fields in a Grid Container. You can replace the part of the code that disables fields with the code that adds on change event.

1 Like

Aaaarghhhh. I always forget that one.
It’s just a pitty that you can’t address a grid with i.e. fd.grid(‘gridname’)…
Something for next release? :wink:

@bartplessers,

Thank you! I passed your suggestion to developers and they created a task for it.

1 Like