FlexGrid view not updating on CollectionView refresh

Posted by: johnny.su on 24 January 2018, 6:57 pm EST

    • Post Options:
    • Link

    Posted 24 January 2018, 6:57 pm EST

    Hi,

    We use a CollectionView object as the item source for our flexgrid table. With the latest version of flexgrid, calling refresh on the CollectionView object doesn’t update the table view.

    I think it has to do with the virtualization changes with the latest release. Custom cells are not created as often as they do with the previous releases.

    Is there a way for the table to refresh when CollectionView refresh is called?

    Regards,

    Johnny

  • Posted 24 January 2018, 9:26 pm EST

    Another to put it is how can I trigger virtualization on demand?

  • Posted 25 January 2018, 3:11 am EST

    Hi Johny,

    We are sorry, we are unable to replicate the issue at our end. Here is the sample fiddle for infinite scrolling which uses refresh method and works fine.

    http://jsfiddle.net/Wijmo5/hwr2ra1q/

    If the issue persists , please modify the fiddle sample depicting your issue.

    ~Manish

  • Posted 25 January 2018, 12:39 pm EST

    Hi Manish,

    Our table is paged. We don’t have vertical scrolling. Horizontal scrolling does virtualize the cells. We have custom template cells in our table and the binding for those customs cells could change because of something happening outside of the table. When the binding changes, we call collectionView.refresh() and that causes the cells in the table to virtualize without calling flex.refresh(true) in version 5.20171.300. Upgrading to version 5.20172.359 broke this. Calling flex.refresh(true) doesn’t trigger virtualization on the custom cells.

    With version 5.20172.359, the custom cells does not automatically virtualize when I interact with the table which is what we prefer because it improves performance. Because it’s not virtualizing the custom cells now we need a way to trigger virtualization when there are binding changes to the custom cells.

    Regards,

    Johnny

  • Posted 26 January 2018, 12:56 pm EST

    If there is a way to recycle all the cells in all custom cell template columns on-demand, then that would solve my issue.

  • Posted 30 January 2018, 6:05 am EST

    Hi Johny,

    You may call invalidate method to recycle FlexGrid cells. If you may share a demo sample depicting your issue, we can investigate and do the needful.

    ~Manish

  • Posted 7 March 2018, 3:01 pm EST

    Hi Manish,

    Finally got the chance to create a Fiddle to demonstrate the issue: http://jsfiddle.net/dj5gpynp/20/. I’m sure you’re familiar with this Fiddle as I’d been using it for another post.

    If you click the ‘Update ID’ button right above the grid it’s supposed to update the first ID value to 999. The function that update the value also calls refresh() on the grid. I also tried invalidate but didn’t help. After clicking the button, the grid doesn’t get updated but if you put the cell into edit mode (double click) you can see the updated value.

    Regards,

    Johnny

  • Posted 8 March 2018, 2:53 am EST

    Hi,

    This seems to be an issue with the Cell Template implementation. I have updated the fiddle.

    Let me know if you are still facing issues.

    http://jsfiddle.net/e0d66x2d/1/

  • Posted 8 March 2018, 3:05 pm EST

    Hi,

    What if I actually do need to display some custom value based on the entered value?

    For example, enter 100 in the edit cell and have the cell display $100 USD or some other value based on configuration data that the controller reads. That’s why instead of using $item.id I created a new variable on the scope so I can set a custom value. In a way, I want to have the display cell re-rendered.

    Regards,

    Johnny

  • Posted 9 March 2018, 1:51 am EST

    Hi,

    In that case you can use item-formatter to display some custom values.

    Please refer to following updated fiddle that displays custom values based on cell values.

    http://jsfiddle.net/t7rLm4n0/

  • Posted 9 March 2018, 6:08 pm EST

    Hi,

    We have various custom cell templates that contain more than one kind of UI elements with special functions/bindings attached to them. I don’t think using the item formatter would be an elegant solution. I updated the fiddle to illustrate one example of custom cell templates that exist in our system: http://jsfiddle.net/t7rLm4n0/1/.

    Please take a look and let me know if there’s another solution that might be more elegant. We currently wrapped the content of our custom cell templates in element directives.

    Thanks,

    Johnny

  • Posted 12 March 2018, 6:38 am EST

    Johhny,

    Another way would to use the Watch. Take a look at the sample and let me know

    http://jsfiddle.net/4g2f3e4c/1/

  • Posted 13 March 2018, 1:58 am EST

    Hi,

    Adding a watch does help but it slows down the table a bunch. I’ll play around with it more.

    Thanks for your help!

    Regards,

    Johnny

  • Posted 13 March 2018, 6:12 am EST

    Yes, that’s expected . I don’t think are anymore ways to accomplish this.

Need extra support?

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

Learn More

Forum Channels