Our pure JavaScript Scheduler component


Post by GopNovel »

Hi Team,

Is it possible to open up menu items when we click on an icon in the column. I have an action column with an icon on it. When I click on icon I want the cellMenuItems to show up. Is it possible?

When I right click on the column I can see the menu items, but I want it to open on an icon click.

columns={[
                        {
                            text: "User",
                            showImage: false,
                            width: 130,
                            field: "name",
                            editor: false
                        },
                        {
                            type    : 'action',
                            text    : 'Actions',
                            width   : 80,
                            align   : 'center',                            
cellMenuItems: [ { text: 'Menu 1', icon: 'b-fa b-fa-pen', onItem : async({ record }) => { console.log(record)} }, { text: 'Menu 2', icon: 'fa fa-beer', onItem : async({ record }) => { console.log(record)}
} ], actions : [{ cls : 'b-fa b-fa-fw b-fa-plus', tooltip : 'Add task', onClick : async({ record }) => {
alert('click here')
} }], } ]}

Thanks and Regards


Post by mats »

Sure, you can learn this from the docs of the https://bryntum.com/docs/scheduler/#Core/widget/Menu class. Very easy to make a custom menu.

let menu = new Menu({
    items      : [
        {
            icon : 'b-icon b-icon-add',
            text : 'Add'
        },
 });
 
 menu.show();

Post by GopNovel »

Hi Mat,

Thanks but this menu is not what I was looking for.

I am attaching a gif of what is happening. Here when I click on '+' symbol I need to show the menu like when I right click on the cell. I tried the menu you mentioned. But it doesnt place inside cell for each record.

Attachments
IconAdd.gif
IconAdd.gif (103.27 KiB) Viewed 910 times

Post by mats »

Ok the code I pasted was just to get you started. You need read the documentation and then write some code to do what you want, it's very simple - just refer to the documentation to help you. And post here if you get stuck.


Post by GopNovel »

Sure, thanks


Post Reply