Posted 4 July 2024, 8:43 pm EST - Updated 4 July 2024, 8:52 pm EST
Hi Team!
I’ve got a problem to set my Designer component option.
I try to show Field List when Designer-workbook init, but the code below not works.
I call this methos at designerInitialized.
Data tab(ribbon)'s first button has been customed to checkbox style also(checked, fieldList shown. unchecked, hide), Does this affect rendering condition?
It will be the pleasure if you guys help me.
also is there any good way to not manipulating DOM and give the style to ribbon and top panel (the last part) please let me know!
have a nice day!
const getDesignerFromSsJson = (designer: Designer, ssJson: string,
designerContainerDivId: string, ribbon ? : string, topPanels ? : string
) => {
//
if (!ssJson) return;
const config = GC_Designer.
Spread.
Sheets.
Designer.
ToolBarModeConfig;
designer.
setConfig(config);
const workbook = designer.
getWorkbook()
as
Workbook;
workbook.
suspendPaint();
workbook.
commandManager().
execute({
cmd: GC_Designer.
Spread.
Sheets.
Designer.
CommandNames.
ShowFieldList
})
workbook.
fromJSON(JSON.parse(ssJson));
workbook.
resumePaint();
const element1 = document.
getElementById(designerContainerDivId)?.
querySelector(" .ribbon ")
as HTMLElement;
element1.style.display = ribbon || "
block " ;
const element2 = document.
getElementById(designerContainerDivId)?.querySelector(" .top -
panels ")
as HTMLElement; element2.style.display = topPanels || "
none " ;
};