bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
54 stars 6 forks source link

MenuItem to trigger `action` event #9736

Open matsbryntse opened 3 months ago

matsbryntse commented 3 months ago

Could you please consider to add in MenuItem also:

item.trigger('action', itemEvent);

Screenshot 2024-02-03 at 19 55 43

So we can have one handler definition in namedItems instead of 2, so it can be re-used for both buttons and menu items:

    namedItems: {
                removeRow: {
                    text: 'Remove row',
                    onItem: 'ctrl.onRemoveRowClick',
                    onAction: 'ctrl.onRemoveRowClick',
                },
            },

=>

    namedItems: {
                removeRow: {
                    text: 'Remove row',
                    onAction: 'ctrl.onRemoveRowClick',
                },
            },

Originally posted by @vadimpopa in https://github.com/bryntum/support/issues/8266#issuecomment-1925414302