Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created October 8, 2020 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/861e1be2699b9e103cc054dcbd407bf0 to your computer and use it in GitHub Desktop.
Save bjoerntx/861e1be2699b9e103cc054dcbd407bf0 to your computer and use it in GitHub Desktop.
// stores the selected conditions in the cell name
function setTableCellConditions(empty = false) {
TXTextControl.tables.getItem(function (table) {
if (table === null)
return; // no table
// create a cellFilterInstructions object
var cellFilterInstructions = {
compareValue: document.getElementById("compareValue").value,
operator: document.getElementById("operator").value,
trueColor: document.getElementById("trueColor").value,
falseColor: document.getElementById("falseColor").value
}
table.cells.getItemAtInputPosition(function (cell) {
if (cell === null)
return; // no cell
if (empty === true)
cell.setName(""); // delete instructions
else
// sel instructions to cell name
cell.setName(JSON.stringify(cellFilterInstructions));
});
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment