Automatically Removing NET From a Table

From Q
Jump to: navigation, search

Deletes the NET column and row from tables (if they exist). Does not delete any nets that have been manually created or renamed (i.e., it works by looking for the word 'NET').

includeWeb("Table JavaScript Utility Functions");

// Delete any NET columns
var n_deleted_cols = 0;
table.netColumns.forEach(function (net_col) {
    deleteColumnComplete(net_col - n_deleted_cols);
    n_deleted_cols++;
});

// Delete any NET rows
var n_deleted_rows = 0;
table.netRows.forEach(function (net_row) {
    deleteRowComplete(net_row - n_deleted_rows);
    n_deleted_rows++;
});

Note that the code above also removes the NET from below_table and right_table, which correspond to the tables for the Statistics - Below and Statistics - Right respectively. These tables must be addressed separately - they do not automatically update when the main table is changed. The two functions deleteColumnComplete() and deleteRowComplete() can be used to address the extra tables automatically whenever they are shown on the table.

See also