SpreadJS Documentation
protectionOption Method
The elements that you want users to be able to change. value.allowSelectLockedCells: boolean type, True or undefined if the user can select locked cells. value.allowSelectUnlockedCells: boolean type, True or undefined if the user can select unlocked cells. value.allowSort: boolean type, True if the user can sort ranges. value.allowFilter: boolean type, True if the user can filter ranges. value.allowEditObjects: boolean type, True if the user can edit floating objects. value.allowResizeRows: boolean type, True if the user can resize rows. value.allowResizeColumns: boolean type, True if the user can resize columns.
Gets or sets a value that indicates the elements that you want users to be able to change.
Syntax
var instance = new GcSpread.Sheets.Sheet(name);
var returnValue; // Type: Object
returnValue = instance.protectionOption(value);
function protectionOption( 
   value : Object
) : Object;

Parameters

value
The elements that you want users to be able to change. value.allowSelectLockedCells: boolean type, True or undefined if the user can select locked cells. value.allowSelectUnlockedCells: boolean type, True or undefined if the user can select unlocked cells. value.allowSort: boolean type, True if the user can sort ranges. value.allowFilter: boolean type, True if the user can filter ranges. value.allowEditObjects: boolean type, True if the user can edit floating objects. value.allowResizeRows: boolean type, True if the user can resize rows. value.allowResizeColumns: boolean type, True if the user can resize columns.

Return Value

The elements that you want users to be able to change.
Example
This example allows locked cells to be selected.
activeSheet.setValue(0, 0, 10);
activeSheet.setValue(1, 1, 100);
activeSheet.setValue(2, 0, 50);
activeSheet.setValue(3, 0, 40);
activeSheet.setValue(4, 0, 80);
activeSheet.setValue(5, 0, 1);
activeSheet.setValue(6, 0, 65);
activeSheet.setValue(7, 0, 20);
activeSheet.setValue(8, 0, 30);
activeSheet.setValue(9, 0, 35);
activeSheet.getCell(1, 1).locked(true);
activeSheet.setIsProtected(true);
activeSheet.protectionOption().allowResizeRows = true;
activeSheet.protectionOption().allowResizeColumns = false;
activeSheet.protectionOption().allowSelectLockedCells = true;
Remarks
allowSelectLockedCells boolean type True or undefined if the user can select locked cells.
allowSelectUnlockedCells boolean type True or undefined if the user can select unlocked cells.
allowSort boolean type True if the user can sort ranges.
allowFilter boolean type True if the user can filter ranges.
allowEditObjects boolean type True if the user can edit floating objects.
allowResizeRows boolean type True if the user can resize rows.
allowResizeColumns boolean type True if the user can resize columns.

The allowSort option applies to sorting in the filter dialog. The allowEditObjects option applies to selecting floating objects and selecting or editing comments.

See Also

Reference

Sheet type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.