Wijmo Flexgrid cell behaviour

Posted by: unnati.kbalas on 20 December 2019, 7:41 am EST

  • Posted 20 December 2019, 7:41 am EST

    I generated flexgrid by back end, fill out values also and now I’m trying to put dropdown and many other controls but its not working with my code and when I click on other cell, my first cell losing the control. I uploaded both cases screenshot in that 1st one is when page load and 2nd one is when I click on other cell. My code snippet:

    html: ```

    <wj-flex-grid #flexGrid

    [stickyHeaders]=“true”

    id=“flexGrid”

    [selectionMode]=“1”

    (initialized)=“initGrid(flexGrid)”

    (cellEditEnding)=“cellEditEndingHandler($event)”

    class=“bento-flex-grid watch-field-flex-grid”

    [headersVisibility]=“1”

    [frozenColumns]=“3”>

    service:     
    import * as wjcCore from '@grapecity/wijmo';
    import * as wjcGrid from '@grapecity/wijmo.grid';
    import * as input from '@grapecity/wijmo.input';
    
    formatFlaxGrid(grid: wjcGrid.FlexGrid, columnGroups: any[]) {
    	  grid.formatItem.addHandler((s, e: 
         wjcGrid.FormatItemEventArgs) => {
    		 const theComboBox = new input.ComboBox(e.cell, {  itemsSource: tems });
        })
    });
    [img]https://gccontent.blob.core.windows.net/forum-uploads/file-4f2d188c-915b-45d0-9a24-8a8645f7ab5c.png[/img][img]https://gccontent.blob.core.windows.net/forum-uploads/file-c070f8be-18fc-4348-b083-fedbdede54bb.png[/img]
  • Posted 20 December 2019, 7:58 am EST - Updated 3 October 2022, 6:25 pm EST

    Adding to this

  • Posted 23 December 2019, 4:59 am EST

    Hi Unnati,

    The issue may be occurring because when the formatItem event runs for the first time, it creates ComboBox for each of the cells. But, when you click on another cell, the formatItem again creates ComboBox for each cell, but now these cells already have a hosted wijmo control which may throw an error.

    I would recommend you use the DataMap if you wish to add a drop-down to the cells:

    https://www.grapecity.com/wijmo/demos/Grid/Columns/DataMaps/angular

    Regards,

    Ashwin

  • Posted 24 December 2019, 2:32 am EST

    Thank you ashwin, but I tried using DataMap also it causes weird behavior on my grid, keep getting update though I’m using this and I already put if condition to create one time Combobox for each cell. still getting the same issue why this grid cell changing its control.

  • Posted 26 December 2019, 1:08 am EST

    Hi Unnati,

    I have created a sample for your convenience using the DataMaps. Could you please modify the sample so that it replicates the issue of the DataMap so that I could assist you further?

    Sample Link: https://stackblitz.com/edit/angular-j2wtnm

    ~regards

Need extra support?

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

Learn More

Forum Channels