Removing an item from a CollectionView

Posted by: andreas.knuth on 21 November 2019, 10:53 am EST

    • Post Options:
    • Link

    Posted 21 November 2019, 10:53 am EST

    Hi,

    first of all I’ve to apologize for not delivering an example for my concern but stackblitz actually doesn’t accept the actual version of wijmo (5.20193.637).

    I’m using Angular8 & the actual version of Wijmo & I set the new refreshOnEdit property for the CollectionView to false.

    → new CollectionView(this._getData(), {refreshOnEdit: false });

    Now I want to remove an entry by using

    → data.remove(item)

    but the entry still keeps in the view. Using data.refresh() removes the item but applies sort & filter.

    So the question is: Is there a way to remove an item from the grid without sort & filter being applied ?

    best regards,

    Andreas

  • Posted 25 November 2019, 2:55 am EST

    Hi Andreas,

    Please do not apologize for not providing the sample. You have given enough information so that we can replicate the issue. Also, could you please let us know what issue is arising on the Stackblitz website?

    Regarding your question:

    We are sorry but this is not possible. When you set the refreshOnEdit property to false, and then call the refresh method, all of the pending changes like removing, sorting, filtering, etc are applied on the data source.

    Regards,

    Ashwin

  • Posted 25 November 2019, 7:05 am EST - Updated 3 October 2022, 6:41 pm EST

    Hi Ashwin,

    thanks for your reply.

    regarding stackblitz:

    I forked my last sample (https://stackblitz.com/edit/angular-wawupw) and changed the wijmo dependencies to the actual version. stackblitz tried to install the dependencies but failed …

    regarding your answer:

    Wouldn’t it be great to have a method commitRemove on the CollectionView as for creating and editing data (commitNew, commitEdit) ? Probably a feature inquiry …

    regards,

    Andreas

  • Posted 26 November 2019, 12:39 am EST

    Hi Andreas,

    Regarding Stackblitz:

    Could you please try using the ‘rc’ version of wijmo in the package.json file.

    Regarding the CollectionView:

    I have asked the dev team to look into this. The internal tracking id of the case is 408418. I will give you an update as soon as I will hear from them.

    ~regards

  • Posted 27 November 2019, 12:59 am EST

    Hi Andreas,

    The dev team has updated the CollectionView class in the latest nightly build. Now, the data will be removed by using the remove method independent of the value of refreshOnEdit. So, when you will remove any data, the sorting and filtering will not be applied until you call the refresh method. You may verify the same using the sample below:

    https://stackblitz.com/edit/angular-mnfsnk

    PS: Nightly builds are not suitable in the production environment.

    ~regards

  • Posted 27 November 2019, 5:45 am EST

    Hi Ashwin,

    great news !! I am very happy that all CRUD operations are now supported for the refreshOnEdit=false mode. That feature will probably be included in the next release.

    regarding the Stackblitz problem:

    I found out that the following combination worked:

    
        "@grapecity/wijmo": "5.20193.637-rc",
        "@grapecity/wijmo.grid": "5.20193.637-rc",
        "@grapecity/wijmo.angular2.grid": "5.20193.637-rc",
        "@grapecity/wijmo.angular2.grid.filter": "5.20193.637-rc",
        "@grapecity/wijmo.grid.filter": "5.20193.637-rc",
        "@grapecity/wijmo.input": "5.20193.637",
        "@grapecity/wijmo.interop.grid": "^5.20193.637",
        "@grapecity/wijmo.styles": "5.20193.637",
    
    

    but please don’t ask me why :slight_smile:

    best regards,

    Andreas

Need extra support?

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

Learn More

Forum Channels