FlexGrid data not refreshing properly when using FlexGridFilter

Posted by: venkata.vimjam on 18 June 2018, 5:34 am EST

    • Post Options:
    • Link

    Posted 18 June 2018, 5:34 am EST

    When flexgrid filter is used , grid.collectionView.refresh() is removing any new manually inserted data.

    Steps to reproduce issue:

    1. In components/Page2.vue line 76 comment out flexgrid filter initialization.
    2. Paste 10 rows in one column, and see that all the 10 columns are visible after pasting event is processed.
    3. Now un comment the flexgrid filter initialization & repeat above steps.
    4. Only 2 rows of data is visible.

    Reason:

    In PastingOld function , line 188 where collection view is refreshed the manually inserted data is removed.

    Is there an another way i can initialize the grid with flexgrid filter and avoid this issue.

    WijmoRefreshDemo.zip

  • Posted 18 June 2018, 5:35 am EST

    Attached in OP is the demo to replicate the issue.

  • Posted 19 June 2018, 1:11 am EST

    Hi,

    The problem is arising due to pushing the new item on items property of editableCollectionView which is not the recommended way to add a new item.

    You should use addNew() and commitNew() methods to add a new item to IEditableCollectionView.

    Please refer to following code snippet to add new item:

    var obj= collectionView.addNew();
    obj['rowId']="someId";
    obj['rowVal']="someValue";
    
    /* commit new item */
    collectionView.commitNew();
    
    /* to cancel the new item addition
    collectionView.cancelNew(); */
    
    

    Please refer to following code snippet to edit an item

    
    var item=editableCollectionView.items[0];
    editableCollectionView.editItem(item);
    /* make changes to item */
    item['id']="someid";
    /*commit or cancel edit via cancelEdit()/commitEdit() method*/
    editableCollectionView.commitEdit();
    
    

    If you would like to edit the underlying sourceCollection then use collectionView.sourceCollection property to get an instance of the underlying source and make updates as required.

    Please refer to following code snippet for the same

    var item={};
    /* push this item on the source of collectionView */
    collectionView.sourceCollection.push(item);
    collectionView.refresh();
    

    You can also refer to attached updated sample.

    ~Manish

    wijmoRefreshDemo_update.zip

  • Posted 19 June 2018, 8:17 am EST

    Thank you Manish.

Need extra support?

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

Learn More

Forum Channels