您好,经调研,可以执行下面的代码实现您的需求
- var pivotTablePanelCommand = GC.Spread.Sheets.Designer.getCommand("pivotTablePanel");
- pivotTablePanelCommand.visibleContext = "controlByMyself";
- var fieldListCmd = GC.Spread.Sheets.Designer.getCommand('pivotTableFieldList');
- var fieldListOldExec = fieldListCmd.execute;
- var fieldListOldGetState = fieldListCmd.getState;
- fieldListCmd.execute = function (context) {
- return context.setData("controlByMyself", !context.getData("controlByMyself"));
- }
- fieldListCmd.getState = function (context) {
- return context.getData("controlByMyself");
- }
- var config = GC.Spread.Sheets.Designer.DefaultConfig;
- config.commandMap = {
- pivotTablePanel: pivotTablePanelCommand,
- pivotTableFieldList: fieldListCmd
- }
- var designer = new GC.Spread.Sheets.Designer.Designer("gc-designer-container", config);
复制代码 结果如下:
|