Scripting Guide > Data Tables > Basic Data Table Scripting > Prevent Changes to a Data Table
发布日期: 08/07/2020

Prevent Changes to a Data Table

To prevent editing cells in the data table, use Set Edit Lock with the Modify Cells argument.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Set Edit Lock( "Modify Cells" );

To prevent adding or deleting columns and rows:

dt << Set Edit Lock( "Add Columns", "Delete Dolumns");
dt << Set Edit Lock( "Add Rows", "Delete Rows");

To get a list of data table operations that are locked, use Get Edit Lock:

dt << Get Edit Lock();

{"Modify Cells", "Add Rows", "Delete Rows", "Add Columns", "Delete Columns"}

To allow a specific data table operation again, use Clear Edit Lock:

dt << Clear Edit Lock( "Modify Cells" );

You can lock all three data table components (cells, columns, and rows) at once by using Lock Data Table.

dt << Lock Data Table( 1 );
需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).