Posted 15 November 2017, 10:53 am EST
Over the last few weeks, I have been implementing the Flex Grid in a new web application that we are creating. There are a few things that I am struggling with that I believe have to be caused by something I am not doing correctly when binding the flex grid to an array of items.
For broader scope - since I haven’t tried making a standalone example yet - our page currently has two grid controls. The screenshots shown above will show the layout of the page. The first grid on the left is a read-only grid that shows a list of users. This grid is only used as a selection mechanism, and pushes the selection using a broadcast through the root scope. The second grid, on the right of the page, is an editing grid that shows time card punches for the selected user. After the page has loaded, everything loads and appears to work nicely.
The issue I have been fighting starts to happen when I change the selected user in the left hand grid. I am currently creating a new CollectionView using the controller variable that holds my array of records whenever the selected row in the selection grid changes. Even when I do that, I have a very difficult time getting the grid to refresh correctly. My screenshot shows that I have a tab control that displays either the grid, or a more graphical / visual way of editing. Because I can see that the UI on the other tab updates whenever my controller punch array variable updates, I know that I am getting the correct data back from my OData calls and that my scope variable has updated correctly. The following screenshot shows what happens when I try changing to a different user.
I did add a full grid refresh to the tab selection, so sometimes when I change to my other editing interface and then back to the grid tab, the grid will now appear with the correct data.
So, I’m hoping that someone can help point me to a good example that works with an array of items that changes dynamically - aside from some of the OData / web service samples, all I see are static arrays that are never being changed and updated with new data.