Is there a simple way to define that datatable or tree uses context menu and load context menu dynamically?
I’d like to generate context menu only when context menu requested, and based on current context data. Something like: http://webix.com/snippet/b28f38c8
I.e. define configuration of context menu together with loaded element (mytree) and load content upon request (right mouse click).
Looks like with XML data “parse”-method for context menu has issues: http://webix.com/snippet/e98641d1
The XML data is generated, but parser does not pick it up.
Btw, repeated context calls (right-clicks) will double the menu options.
Could not figure out how to clean list of options.
How can I define the width of ContextMenu?
In the example below the ContextMenu is too narrow, and menu items do not fit: http://webix.com/snippet/5d61b385
Based on your example I created a protoUI of datatable that contains simplified support of context menu. (http://webix.com/snippet/1aeb8944)
More questions arisen.
Is it possible to:
Initialize Context menu configuration via XML? Current example uses hard-coded init?
Set width automatically, based on width of popup menu content?
Retrieve column value by Column Index, instead of Column Name (list.getItem(listId).title)?
From Context menu “onItemClick” event handler send an event to parent control (datatable in this case), where the context menus is attached to?
add scrollbar to context menu when it’s needed? In example below the menu does not fit the screen. (http://webix.com/snippet/ca38fda5)
Select (highlight) row, where where context menu was poped-up. Currently when I call “this.select(id)” method, the row gets highlighted, but the rest of context menu processing stops working. (http://webix.com/snippet/01a89bc6)
Regarding #1, can you share an example?
Specifically, settings of Context Menu Properies. Sometimes JSON to XML translation is not clear, esp. with nested objects.
Regarding #5, I tried to play with different options.
Permanent scrollbar is annoying when = 5. Not needed, but still there.
yCount has a bug when it’s > 5. (http://webix.com/snippet/89891502).
I’ll keep looking for a nicer solution.
Issue with yCount confirmed, will be fixed in Webix 1.11
Currently if scroll is enabled it is always visible - we plan to add more flexible solution in Webix 2.0
Can Menu Configuration be a part of XML data, returned by “ContextMenuGenerator.ashx” ?
My intention is to have Context Menu Configuration and Data within single XML response.