Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to enable/disable ListGridField depending of ListGridRecord's values

    Hi!

    I have the next ListGrid made of 2 ListGridFields and a set of ListGridRecords:

    Click image for larger version  Name:	Capture.PNG Views:	0 Size:	7.1 KB ID:	265805
    I would like to enable/disable (using setCanEdit(false/true)) the right-column depending on the left-column value ('Texto' -> disable / 'Numerico' -> enable). I was thinking of using a custom ListGridField, with a set of ListGridRecords associated, and when each of those were 'Numerico' then enable the ListGridFields ... but it didn't work ... I can't figure out how to relate those ListGridFields and ListGridRecords ...

    Any suggestion?
    Thanks!
    Last edited by inugam; 30 Jun 2021, 13:06.

    #2
    See the override point listGrid.canEditCell().

    In 13.0 there is also listGridField.enableWhen for a purely declarative approach.

    Is there somewhere in the documentation where it would have been useful to you to have a link or mention of these API, so you would have found it yourself? We are constantly trying to improve the documentation to ensure that correct approaches are found.

    Comment

    Working...
    X