Posted 9 August 2023, 10:20 pm EST - Updated 9 August 2023, 10:46 pm EST
Update settings in Spread Settings tab and Sheet Settings tab
Posted by: thanh.minh.le on 9 August 2023, 10:20 pm EST
-
-
Posted 10 August 2023, 2:08 am EST
Hi,
The Spread/Sheets Dialog show the Spread/Sheets properties defined in the Spread/Sheet.
For example, to check the “Allow Drag and Drop” and uncheck the “Allow Drag and Merge” on Spread Settings Dialog, you could use the following options on the Spread.
[code]
// Workbook Settings
// Uncheck User Drag Drop
spread.options.allowUserDragDrop = false;// Check Allow Drag And Merge
spread.options.allowUserDragMerge = true;// Change Resize Mode
spread.options.rowResizeMode = GC.Spread.Sheets.ResizeMode.split
[/code];You could refer to the following APIs on all the workbook options available: https://www.grapecity.com/spreadjs/api/v15/interfaces/GC.Spread.Sheets.IWorkbookOptions
Similarly, for unchecking the “Allow OverFlow” option on Sheet Settings Dialog, you could use the following options on Sheet.
// Worksheet Options sheet.options.allowCellOverflow = false;
You could refer to the following options available on WorkSheet: https://www.grapecity.com/spreadjs/api/interfaces/GC.Spread.Sheets.IWorksheetOptions#interface-iworksheetoptions
To disable the checkboxes, you could modify the SpreadSettingDialogTemplate/ SheetSettingDialogTemplate dialogs and add a class name to disable the element.
You could refer to the following code snippet:
// Get the Spread Settings Template var spreadSettingsTemplate = GC.Spread.Sheets.Designer.getTemplate(GC.Spread.Sheets.Designer.TemplateNames.SpreadSettingDialogTemplate); // Get the Allow User Drag Drop CheckBox let allowUserDragDropCheckbox = spreadSettingsTemplate.content[0].children[0].children[0].children[0].children[2].children[0].children[0]; // Add Disabled Class Name allowUserDragDropCheckbox.className = "disabledClass"; // Reregister the template GC.Spread.Sheets.Designer.registerTemplate(GC.Spread.Sheets.Designer.TemplateNames.SpreadSettingDialogTemplate, spreadSettingsTemplate); // Get the Sheets Settings Template var sheetSettingsTemplate = GC.Spread.Sheets.Designer.getTemplate(GC.Spread.Sheets.Designer.TemplateNames.SheetSettingDialogTemplate); // Add Disabled Class Name let allowOverFlowCheckBox = sheetSettingsTemplate.content[0].children[0].children[0].children[0].children[0].children[1].children[1]; // Add Disabled Class Name allowOverFlowCheckBox.className = "disabledClass"; // Reregister the template GC.Spread.Sheets.Designer.registerTemplate(GC.Spread.Sheets.Designer.TemplateNames.SheetSettingDialogTemplate, sheetSettingsTemplate);
References:
SheetSettingDialog Template: https://www.grapecity.com/spreadjs/api/v15/designer/classes/GC.Spread.Sheets.Designer.TemplateNames#sheetsettingdialogtemplate
SpreadSettingDialog Template: https://www.grapecity.com/spreadjs/api/v15/designer/classes/GC.Spread.Sheets.Designer.TemplateNames#spreadsettingdialogtemplate
getTemplate method: https://www.grapecity.com/spreadjs/api/v15/designer/modules/GC.Spread.Sheets.Designer#gettemplate
IComponentBase Options: https://www.grapecity.com/spreadjs/api/v16/designer/interfaces/GC.Spread.Sheets.Designer.IComponentBaseOption#interface-icomponentbaseoption
Regards,
Ankit