Posted 7 April 2025, 4:51 pm EST - Updated 7 April 2025, 4:56 pm EST
Customizing page setup pop up
Posted by: esiey.brhane on 7 April 2025, 4:51 pm EST
-
-
Posted 8 April 2025, 4:51 am EST - Updated 8 April 2025, 4:56 am EST
Hi,
Yes, the Page Setup dialog in SpreadJS Designer corresponds to the “GC.Spread.Sheets.Designer.TemplateNames.PageSetupDialogTemplate” template. You can customize this template to remove any undesired sections from the dialog.
Please find below a sample code snippet demonstrating how to remove the “Fit to” option from the Page Setup dialog:
var pageSetupDialogTemplate = GC.Spread.Sheets.Designer.getTemplate(GC.Spread.Sheets.Designer.TemplateNames.PageSetupDialogTemplate); var fitTo = pageSetupDialogTemplate.content[0].children[0].children[3].children[0].children[0].items; // Find the index of the "Fit to" item var fitToIndex = fitTo.findIndex(item => item.text === "Fit to:"); // If the item is found, remove it if (fitToIndex !== -1) { fitTo.splice(fitToIndex, 1); } // removing the setting portion associated with fit to: var fitToSetting = pageSetupDialogTemplate.content[0].children[0].children[3].children[1].children[1] = {}; //registering the updated Template back GC.Spread.Sheets.Designer.registerTemplate(GC.Spread.Sheets.Designer.TemplateNames.PageSetupDialogTemplate, pageSetupDialogTemplate)
Expected Ouput:
References:
registerTemplate: https://developer.mescius.com/spreadjs/api/designer/modules/GC.Spread.Sheets.Designer#registertemplate
PageSetupDialogTemplate: https://developer.mescius.com/spreadjs/api/designer/classes/GC.Spread.Sheets.Designer.TemplateNames#pagesetupdialogtemplate
getTemplate: https://developer.mescius.com/spreadjs/api/designer/classes/GC.Spread.Sheets.Designer.AtomicComponentBase#gettemplate
Hope this helps! Please let me know if you have any further questions.
Best Regards,
Ankit
-
Posted 8 April 2025, 9:24 am EST
Is there anyway to change the print screen through the fileMenuPanelTemplate. I want to remove the scaling options there too.
-
Posted 10 April 2025, 6:01 am EST - Updated 10 April 2025, 6:06 am EST
Hi,
Yes, this can be achieved by applying display: none to the specific scaling element within the DOM using CSS. Below is a sample CSS snippet that targets the desired element:
.gc-spread-designer-filemenu-print-container .gc-spread-designer-filemenu-left-aside .gc-flex-component .gc-container div:nth-child(4) { display: none; }
Sample:
Expected Output:
Hope this helps! Please feel free to reach out if you have any further questions.
Best regards,
Ankit
-
Posted 10 April 2025, 10:46 pm EST
Hi,
Is there a way to change the print a way to change the options available on the print screen. It seems that the margins interfere with the page breaks and cause unnecessary blanks on every second page. This happens when you set margins and the orientation is landscape. Is there a way to only use the settings the user selects in the page layout and setup.
-
Posted 11 April 2025, 3:00 am EST
Hi,
Regarding “It seems that the margins interfere with the page breaks and cause unnecessary blanks on every second page. This happens when you set margins and the orientation is landscape.” — I’m not entirely sure about the issue you’re encountering. Could you please elaborate further, ideally with some examples or a GIF/video demonstrating the behavior?
As for “Is there a way to only use the settings the user selects in the page layout and setup?” — could you also provide a bit more detail on this, perhaps with some specific scenarios or examples?
Regards,
Priyam