Posted 8 August 2019, 11:38 pm EST
Hello again,
I got the FlexGrid working with KnockoutJs.
Now I am trying to integrate the wjContextMenu. ( https://www.grapecity.com/wijmo/api/classes/wijmo_knockout_input.wjcontextmenu.html )
The example there works fine, but when I try to use that binding on the same class where I already have a wjFlexGrid, the Grid wont display data anymore.
I get this error in JS console:
Error: Unable to process binding "wjContextMenu: function(){return { id:'#contextmenu'} }"
Message: You cannot apply bindings multiple times to the same element.
This is my code:
<div id="contextmenu" data-bind="wjMenu: { header: 'File', itemClicked: menuItemClicked}" style="display: none">
<span data-bind="wjMenuItem: {}">New</span>
<span data-bind="wjMenuItem: {}">open an existing file or folder</span>
<span data-bind="wjMenuItem: {}">save the current file</span>
<span data-bind="wjMenuSeparator: {}"></span>
<span data-bind="wjMenuItem: {}">exit the application</span>
</div>
<p data-bind="wjContextMenu: { id: '#contextmenu'}">
This paragraph has a context menu.
</p>
<div class="custom-flex-grid"
data-bind="wjFlexGrid: {
itemsSource: treeData,
childItemsPath: 'childItems',
selectionMode: 'ListBox',
headersVisibility: 'Column',
},
wjContextMenu: { id: '#contextmenu'}">
<div data-bind="wjFlexGridColumn: { binding: 'name', width: '*', align: 'left' }"></div>
<div data-bind="wjFlexGridColumn: { binding: 'fileDate', width: '*', align: 'center' }"></div>
<div data-bind="wjFlexGridColumn: { binding: 'changedFromUser', width: '*' }"></div>
</div>
I hope you guys can help me with this.
(Additional issue: The 3 colums have different widths, although they should be the same, but the 3rd one is too big.)