Posted 8 January 2024, 5:26 pm EST - Updated 8 January 2024, 5:31 pm EST
Creating a custom "Spread Setting" pop up selection
Posted by: fcherny on 8 January 2024, 5:26 pm EST
-
-
Posted 9 January 2024, 2:19 am EST
Hi,
You could update the “SpreadSettingDialog” template to remove the “Allow Auto Create Hyperlink” option. Use the “getTemplate()” method to get the “SpreadSettingDialog” template and “registerTemplate()” method to register the template.
Refer to the following code snippet:
// Get the "SpreadSettingDialogTemplate" let spreadSettingsTemplate = GC.Spread.Sheets.Designer.getTemplate(GC.Spread.Sheets.Designer.TemplateNames.SpreadSettingDialogTemplate); // Remove the option "allowAutoCreateHyperlink" spreadSettingsTemplate.content[0].children[0].children[0].children[0].children[2].children[0].children = spreadSettingsTemplate.content[0].children[0].children[0].children[0].children[2].children[0].children .filter(item => item.bindingPath !== "allowAutoCreateHyperlink"); // Additionally adjust the width of the Column So that there is no overlapping of the text spreadSettingsTemplate.content[0].children[0].children[0].children[0].children[2].children[0].width = "300px"; // Register the "SpreadSettingDialogTemplate" with updated options GC.Spread.Sheets.Designer.registerTemplate(GC.Spread.Sheets.Designer.TemplateNames.SpreadSettingDialogTemplate, spreadSettingsTemplate);
Further, you could set the Spread options using the following code:
// Additionally set the "allowAutoCreateHyperlink" option spread.options.allowAutoCreateHyperlink = false; // Default is true
References:
getTemplate method: https://developer.mescius.com/spreadjs/api/v15/designer/modules/GC.Spread.Sheets.Designer#gettemplate
SpreadSettingDialog Template: https://developer.mescius.com/spreadjs/api/v15/designer/classes/GC.Spread.Sheets.Designer.TemplateNames#spreadsettingdialogtemplate
registerTemplate method: https://developer.mescius.com/spreadjs/api/designer/modules/GC.Spread.Sheets.Designer#registertemplate
Workbook Options: https://developer.mescius.com/spreadjs/api/v17/classes/GC.Spread.Sheets.Workbook#options
TemplateNames Class: https://developer.mescius.com/spreadjs/api/designer/classes/GC.Spread.Sheets.Designer.TemplateNames#class-templatenames
Regards,
Ankit
-
Posted 9 January 2024, 1:21 pm EST
That did it. Thanks!