Skip to content

How to update cell icon programatically? #1633

Answered by KiddoV
KiddoV asked this question in Q&A
Discussion options

You must be logged in to vote

I just have to assign icon field as a function, then had some condition to change icons, for example...

columns: [
    {field: "test", title: "Test Cell", 
      icon: (args) => {
          const record = args.table.getRecordByCell(args.col, args.row);
          if (!record?.fwId || Object.keys(record).length == 0) return "submit";
          else if (record?.cellsEditing?.length) return ["confirm", "cancel"];
          else return "delete";
      }
    }
]

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@KiddoV
Comment options

@fangsmile
Comment options

@KiddoV
Comment options

Answer selected by fangsmile
@fangsmile
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants