Our state of the art Gantt chart


Post by himanshurjoshi »

Hello team, Good Afternoon,

Currently, we are working on BryntumGantt, inside this Gantt, we by default have Grid features. We are trying to implement cellMenu inside this Grid. But somehow we are not able to achieve this. We have access of ganttRef, from this how will reach to cellMenu feature.

**Single column code (Please read the comments)

{
    type: 'action',
    exportable: false,
    cls: 'grid-action-field',
    text: '',
    actions: [
      {
        cls: 'b-fa b-fa-ellipsis-v grid-updated-add task-menu-button',
        onClick: (data: any) => {
          // here we want to show cellMenu 
        },
      };
    ],
  },

^^ Above code is our code

**From here we took reference -> https://bryntum.com/products/schedulerpro/docs/api/Grid/feature/CellMenu

**Reference code from documentation::

{
            type    : 'action',
            actions : [
                {
                    cls : 'b-icon b-fa-ellipsis-h',
                    onClick({ record, target, column, grid }) {
                        grid.features.cellMenu.showMenuFor({ record, column }, { targetElement : target });
                       //^^ We dont have access of this "grid" inside BryntumGantt's grid
                    }
                }
            ]
        }

^^ This code we found on documentation

Last edited by himanshurjoshi on Fri Mar 08, 2024 11:50 am, edited 1 time in total.

Post by mats »

                       //^^ We dont have access of this "grid" inside BryntumGantt's grid

You should have access to it, are you on an older version perhaps? Try upgrading?

You can also use this config to define the CSS selector which should trigger the menu: http://lh/bryntum-suite/grid/docs/#Grid/feature/CellMenu#config-clickTriggerSelector


Post by himanshurjoshi »

Hello Mats,

We are using "@bryntum/gantt": "5.5.3", this version.

**Also, can you please share that link again, as its taking me to an error page.

**And, about grid,

onClick({ record, target, column, grid }) {
      //^^ here we are expecting record, target, column and grid but in our case we are only getting record, target and action [column and grid are not coming <- here we are blocked]
}

Post by tasnim »

Hi,

Please try upgrading, this might help.

Here is the link https://bryntum.com/products/grid/docs/api/Grid/feature/CellMenu#config-clickTriggerSelector

Let us know if that helps :)


Post by himanshurjoshi »

tasnim wrote: Fri Mar 08, 2024 12:27 pm

Hi,

Please try upgrading, this might help.

Here is the link https://bryntum.com/products/grid/docs/api/Grid/feature/CellMenu#config-clickTriggerSelector

Let us know if that helps :)

The version upgrade did not work. Can you please guide us, if you have a better approach?


Post by tasnim »

Hi,

clickTriggerSelector will fire when you click on a grid cell or row. Could you please explain a bit further about your use case that exactly where you want that menu to show? Or you want to show a different menu?


Post by himanshurjoshi »

After using clickTriggerSelector, contextMenu is getting triggered. But our problem is, that our checkbox working has been stopped after implementing this.

features: {
	taskMenu: {
        	clickTriggerSelector: 'task-menu-button',
        	triggerEvent: 'click',
       },	
}

When we show contextMenu with a single click, this checkbox stops working, please refer screenshot.

Image

We want both, on a single click kabab icon should show the context menu, and on a click of checkbox row should be get selected.

Attachments
screenshot-localhost_8000-2024.03.08-18_37_29.png
screenshot-localhost_8000-2024.03.08-18_37_29.png (213.19 KiB) Viewed 144 times

Post by mats »

Remove:

        	triggerEvent: 'click',

And it should work ok!


Post Reply