Wijmo Context menu from Custom menu component

Posted by: rohaanthakare on 28 January 2019, 7:35 am EST

    • Post Options:
    • Link

    Posted 28 January 2019, 7:35 am EST

    In our application we have multiple pages, on each page we have different wijmo grids.

    now to all those grids we want to have same context menu to export grid data to excel.

    so when i added context menu in component html file, like below its working.

    <wj-flex-grid [(itemsSource)]=“testData” [wjContextMenu]=“testMenu”>

    <wj-menu #testMenu class=“ui-widget” (itemClicked)=“itemClicked(testGrid,$event)”>

    <wj-menu-item [value]=“‘exportToExcel’”>

    Export to Excel







    This will export grid data to Excel





    now as i will be using same context menu in all grids, thought of creating generic component menu component, and adding generic component in file, its not showing context menu.

    <app-grid-context-menu #testMenu>

  • Posted 29 January 2019, 2:59 am EST

    Hi,

    We need to expose our menu defined in app-grid-context-menu component and assign the exposed menu to the [wjContextMenu] directive.

    Please refer to the following sample which demonstrates the same:

    https://stackblitz.com/edit/angular-xycwoh?file=src%2Fapp%2Fcontext-menu%2Fcontext-menu.component.ts

    ~Sharad

  • Posted 31 January 2019, 11:05 am EST

    Thanks for solution, its working.

    now we have performance issue, as we are exporting around 40K records. you have any suggestions to improve this?

  • Posted 1 February 2019, 12:58 am EST

    This is expected considering the heavy processing required. What we can do is show some spinner to the user as visual feedback and also try to use JSZIP 3 and saveAsync method so that some possible operations could be performed asynchronously.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels