The new Data Grid component

I’m starting to explore moving from my existing (heavy) usage of the data grid preview (Building a rich table as a custom component) to the new Data Grid component, and at least so far, it seems like there is a bit of gloss over some specific challenges that came up in using the preview version as well.

  1. https://anvil.works/blog/data-grid-searching details adding search support with the exact same methodology (list comprehensions) as in the preview. This still does not address challenges with searching a large data set, since server timeouts will absolutely occur as python list comprehensions cannot take advantage of database indexes and are a poor substitute. This is an understandable tradeoff since SQL queries in a shared environment can lead to resource hogging. However, while the Anvil Dedicated Server plan grants direct access to the database and thus the potential for taking advantage of database indexing for search performance, attempting to use SQL query data set results with a data grid is not documented in any way. Is there a clean way to bridge using a row id (column: _id) from an SQL query result data set over to the object style of passing around rows/items used with the Data Tables service?

    My primary reason for moving to a Dedicated Server plan in this context is for search speed, especially with %LIKE% queries. Since in Anvil, every column in indexed, I really don’t expect to see any significant difference between adding/updating rows using Data Tables or with SQL.

  1. Quickly determining the size of the data set (number of records) while only retrieving/displaying the first X (10, 20, etc.) records doesn’t seem to be addressed.

  2. Since this seems to bear a lot of similarities to the preview version, I suspect that creating a selection grid (where the first column is a checkbox that creates or removes relationships in a one-to-many scenario, for example) is still possible, but a tutorial that walks through such a usage would make this more accessible for an extremely common pattern.

  3. When will we see the Data Tables service use the new Data Grid component in the development environment for both browsing and searching records as well as editing relationships? The current default of loading 100 records is way too much, there is no way to quickly get to record number 1000, for instance, and the relationship editing interface breaks as soon as the number of possible related records is over about 100 records. Ideally relationship editing would have a built-in filter (or search) that shows only selected records.

Thanks for all you guys do to make Anvil more awesome all the time, things like this make it easier and easier to not only choose Anvil for new projects, but increase the runway for either staying on Anvil longer before moving to “power tools” like MEAN/MERN stack (or others) as well as just leaving an app on Anvil indefinitely. Support for mobile apps (on even Progressive Web Apps, as support improves) will make even more possible.

3 Likes