Hello again,
I am currently struggling to upgrade my use of vaadin-grid from 3.0.2 to 4.1.7,
and have encountered some issues which are difficult to resolve with respect
to the data provider.
Let me first explain the model I am working with:
- The data provider uses AJAX calls to a RESTful service.
- The calls are paged (offset, limit).
- The backend implements the necessary sorting and filtering according to the parameters given to the provider.
- The total number of items which a given query will return cannot be known in advance, so it must be deduced (the last size when no further items are returned).
- Hence, the provider update procedure is to call the callback with the current items, and update the size to the total + page size, until no more items, in which case, the table size is set to exactly the total number of items received.
This all worked perfectly well in 3.0.2. In 4.1.7, however, I notice the following:
- On page load, the provider is called multiple times with the same page (0). This makes asynchronous processing tricky.
- On page load, the table cache gets messed up. The rows do not correspond to the data which appears to be given (at least via console logging) to the callback function.
- On refresh or filter change (which clears the provider cache), however, everything goes back to normal –– I imagine because there is no more than one AJAX call in flight at a given time.
- On load, the details expansion does not work. It works after refresh, however.
- When I try to filter and the filter query returns 0 results, I see the following error reported:
TypeError: Argument 1 ('node') to Node.insertBefore must be an instance of Node
I realize this is all very difficult to understand without seeing my code, but I at least wanted to see if I could start a discussion here which might put me on the right track to resolution.
Note: What I am currently doing is trying to block multiple calls to fetch data for the same page without clearing the cache (i.e., without provoking another page load). This hack, however, at least as I have implemented it, is insufficient, because the problems reported above occur in spite of it.
Thanks in advance for any thoughts you might have,
Al Rossi