How to use the terra-table.Utils.toggleArrayValue function in terra-table

To help you get started, we’ve selected a few terra-table examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cerner / terra-core / packages / terra-table / src / terra-dev-site / doc / guides / CheckMarkTable.jsx View on Github external
const handleRowCheckAction = (event, metaData) => {
    event.preventDefault();

    const newKeys = Utils.toggleArrayValue(checkedKeys, metaData.key);
    const isMax = newKeys.length === rowCount;
    setAllChecked(allChecked ? !isMax : isMax);
    setCheckedKeys(isMax ? [] : newKeys);
  };
github cerner / terra-core / packages / terra-table / src / terra-dev-site / doc / guides / SectionTable.jsx View on Github external
const handleSectionToggle = (event, metaData) => {
    event.preventDefault();
    setCollapsedKeys(Utils.toggleArrayValue(collapsedKeys, metaData.key));
  };
github cerner / terra-core / packages / terra-table / src / terra-dev-site / doc / guides / MultiSelectTable.jsx View on Github external
const handleRowToggle = (event, metaData) => {
    event.preventDefault();
    setSelectedKeys(Utils.toggleArrayValue(selectedKeys, metaData.key));
  };