Announcement

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

    Disabling removal of some TreeGrid records

    Is there a way to prevent a user from being able to remove certain records/nodes from a TreeGrid?

    TreeGrid.setCanRemoveRecords(true) applies to all records but I'd like to selectively disable that.

    Thanks.

    #2
    In case anyone else is looking for a solution.

    I implemented my own widget Img in the grid with a custom clickHandler to remove corresponding record. In the createRecordComponent() method, I added logic to determine whether Img widget is to be displayed.

    Comment


      #3
      A better solution is a normal field that uses a CellFormatter to conditionally write out an image and a CellClick handler to implement removal. This is much lighter weight (note that the recordComponents docs steers you away from using it for trivial stuff like this).

      Comment

      Working...
      X