question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Context menu for elements inside Tabulator component

See original GitHub issue

is it currently possible to add a context menu to the input of form elements? lets say a TextInput? If so, how would I go about it? I’m not able to get it working using the way shown in the guide

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rjaroscommented, Jun 23, 2019

I’ve made some tests and it turns out not to be the case of events. The “contextmenu” event is triggered correctly and the context menu is in fact showing. But it cannot be seen, because it’s showing inside incorrect component tree and in incorrect position. I’ve commited some fixes and after 0.0.37 version is released, the following code can be used to open a context menu inside a tabulator component (note that the ContextMenu component must be created inside the onRendered callback and it will be shown in a fixed position):

                    ColumnDefinition(
                        "Name", "name",
                        editorComponentFunction = { _, onRendered, success, _, data ->
                            val textInput = TextInput(value = data.name).apply {
                                size = InputSize.SMALL
                                setEventListener<TextInput> {
                                    change = {
                                        success(self.value)
                                    }
                                }
                            }
                            onRendered {
                                val contextMenu = ContextMenu(textInput, true) {
                                    header(tr("Menu header"))
                                    link(tr("HTML"), "#!/basic")
                                    link(tr("Forms"), "#!/forms")
                                    setEventListener {
                                        click = {
                                            self.hide()
                                        }
                                    }
                                }
                                textInput.setContextMenu(contextMenu)
                            }
                            textInput
                        }
                    )
1reaction
rjaroscommented, Jun 5, 2019

Tabulator overwrites a lot of mouse event handlers for its DOM elements. And it’s probably just overwrites right mouse click as well. I’ve been struggling with this event handlers trying to make Select control work inside Tabulator, but unfortunately I didn’t manage to do it. It could be similar issue. But I will take a closer look at this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Menus, Popups & Alerts | Tabulator
Tabulator has a range of options for providing context menus and header menus on a table. In the example below the headerMenu column...
Read more >
Context menu for Tabulator - Stack Overflow
It is standard practice in a lot of context menu libraries to append the menu directly to the body rather than to the...
Read more >
Setting up Tabulator columnCellContextMenu - Anvil Works
Hi All, I'm trying to set up a Tabulator table with a cell context menu as described in the Tabulator docs: //define row...
Read more >
Easy Data Table Generator with JSON - Tabulator - jQuery Script
Tabulator is a feature-rich jQuery plugin used for generating simple or complex data tables from any JSON data.
Read more >
tabindex - HTML: HyperText Markup Language | MDN
The tabindex global attribute indicates that its element can be focused, and where it participates in sequential keyboard navigation ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found