nhn / tui.grid

🍞🔡 The Powerful Component to Display and Edit Data. Experience the Ultimate Data Transformer!
http://ui.toast.com/tui-grid/
MIT License
2.42k stars 393 forks source link

How to open context menu on click #1896

Open arjanterheegde opened 1 year ago

arjanterheegde commented 1 year ago

Is there a way to open the context menu by a left click on a button (see screenshot)? I've added a custom renderer and want to open the context menu when a user clicks on it. Can someone tell me how to do this?

class contextMenuRenderer {
        constructor(props) {
            const el = document.createElement('i');
            el.setAttribute("aria-hidden", "true");
// onclick open context menu.
            this.el = el;
            this.render(props);
        }

        getElement() {
            return this.el;
        }

        render(props) {
            this.el.className = "ms-Icon ms-Icon--ExpandMenu suggestions-icon";
        }
    }

Header:
 {
                header: " ",
                name: "contextmenu",
                width: 25,
                renderer: {
                    type: contextMenuRenderer
                },
            },

image

arjanterheegde commented 1 year ago

Anyone?

YounghoonYoo commented 10 months ago

this event → toast-contextMenu plugin https://ui.toast.com/tui-context-menu