Regarding this example here http://tabulator.info/docs/5.0/format#icon
In the cellClick function, how can you change the icon used in the formatter?
The use-case is simply changing a folder icon to folder-open when a cell is clicked.
Fairly simple, track the state in the rowData ...
https://jsfiddle.net/hgwz4knp/
cellClick:function(e, cell){
let row = cell.getRow();
let data = row.getData();
row.update({openClosed:data.openClosed ^ 1});
this.redraw(true);
},
formatter:function(cell, fP, onR){
let data = cell.getData();
if (data.openClosed == 1){
return "<i class='fas fa-folder-open'></i>";
}else{
return "<i class='fas fa-folder'></i>";
}
},