CommandName

Posted by: pedro.moraes on 13 December 2024, 1:47 pm EST

    • Post Options:
    • Link

    Posted 13 December 2024, 1:47 pm EST - Updated 13 December 2024, 1:52 pm EST

    Hello,

    How do I know the commandName of these GanttSheet functions

    They don’t appear in DefaultConfig

    And I would like to change some attributes

  • Posted 16 December 2024, 6:30 am EST - Updated 16 December 2024, 6:35 am EST

    Hi,

    Please refer to the names of the commands for corresponding to the image that you have sent.

    For Zoom:

    • GanttSheetSortByStart
    • GanttSheetSortByFinish
    • GanttSheetSortByTaskNumber
    • GanttSheetCustomSort

    For TimeScale Dropdown:

    • GanttSheetTimescaleDropdown

    Task Mode:

    • GanttSheetNewTaskMode

    You could refer to the following API for the command names: https://developer.mescius.com/spreadjs/api/designer/classes/GC.Spread.Sheets.Designer.CommandNames

    Sample: https://jscodemine.mescius.io/share/GgkLrsdWx0mpwTYq5uJzmg/?defaultOpen={"OpenedFileName"%3A["%2Fsrc%2Fapp.js"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.js"}

    Also, all the commands are available in the default config. Make sure, you have included the Gantt Sheet Reference. Refer to the following screenshot of the Default Config showing the commands. If you still face the issue with your sample, kindly share the sample with us so that we could investigate at our end and could help you accordingly.

    Regards,

    Ankit

  • Posted 16 December 2024, 10:08 am EST - Updated 16 December 2024, 10:13 am EST

    Hello,

    But is GanttSheetManuallySchedule and GanttSheetAutoSchedule the same as the buttons inside GanttSheetNewTaskMode?

    Because I changed the icon but it didn’t change at all. And inside the Ribbon in GanttSheetNewTaskMode it doesn’t show anything

    GanttSheetManuallySchedule: {
          title: '',
          text: 'Agendamento automático',
          iconClass: 'icon-manually-schedule', // my icon
          commandName: 'GanttSheetManuallySchedule',
        },
        GanttSheetAutoSchedule: {
          title: '',
          text: 'Agendamento manual',
          iconClass: 'icon-auto-schedule', // my icon
          commandName: 'GanttSheetAutoSchedule',
        },
  • Posted 17 December 2024, 3:17 am EST - Updated 17 December 2024, 3:22 am EST

    Hi,

    I tested at my end and it seems to be working fine at my end. Here is the sample that I have tested with: https://jscodemine.mescius.io/share/qxfc3xlaoEG3Vip7xAjfvQ/?defaultOpen={"OpenedFileName"%3A["%2Fsrc%2Fapp.js"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.js"}

    I am using the following code snippet:

    let config = GC.Spread.Sheets.Designer.DefaultConfig;
    // Merge the new commandMap updates
    config.commandMap = Object.assign({}, config.commandMap, {
        "GanttSheetManuallySchedule": {
            ...GC.Spread.Sheets.Designer.getCommand(GC.Spread.Sheets.Designer.CommandNames.GanttSheetManuallySchedule),
            text: "Agendamento automático",
            iconClass: 'icon-manually-schedule',
            title: ""
        },
        "GanttSheetAutoSchedule": {
            ...GC.Spread.Sheets.Designer.getCommand(GC.Spread.Sheets.Designer.CommandNames.GanttSheetAutoSchedule),
            text: 'Agendamento manual',
            iconClass: 'icon-auto-schedule',
            title: ""
        },
        "GanttSheetNewTaskMode": {
            ...GC.Spread.Sheets.Designer.getCommand(GC.Spread.Sheets.Designer.CommandNames.GanttSheetNewTaskMode),
            dropdownList: GC.Spread.Sheets.Designer.getCommand(
                GC.Spread.Sheets.Designer.CommandNames.GanttSheetNewTaskMode
            ).dropdownList.map(group => ({
                ...group, // Preserve existing group properties
                groupItems: group.groupItems.map(item => ({
                    ...item, // Preserve other item properties
                    text: item.value === "Auto" ? "Custom Auto Text" :
                        item.value === "Manual" ? "Custom Manual Text" : item.text,
                    iconClass: item.value === "Auto" ? "icon-auto-schedule" :
                        item.value === "Manual" ? "icon-manually-schedule" : item.iconClass
                }))
            }))
        }
    });
    
    console.log(config);
    designer.setConfig(config);
    

    Could you kindly share us a sample replicating the issue? Alternatively, you could modify the above sample and share it with us. In the sample, the icon class has been applied to the “index.html” file.

    For information on the Tasks Scheduling Mode, refer to the following docs: https://developer.mescius.com/spreadjs/docs/features/ganttsheet/ganttsheet-task#task-schedule-modes

    Regards,

    Ankit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels