Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-394

Support setting and updating queries in TableViews

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Core

      Right now when you create a TableView from a query, there does not seem to be any way to later update the underlying query. This would be a very useful feature, especially in the context of binding the result to a UI.

      One of the most common use cases for a query result is for it to be bound to some UI element (like for example a UITableView in on iOS). This works fine as is, but sometimes the query is based upon user interaction, like a searchfield, making the conditions of the query change as the user types.

      Today this is pretty cumbersome to work with. You have to do a new query, and then use this to replace the previous query in the UI component, and remember to free all the old notification handlers and create new ones for new query.

      Ideally you would just want to be able to update the underlying query in the TableView, and then have the UI update automatically, since all bindings and notification handlers would still be valid.

      So to mirror TableView::get_query() we should also have TableView::set_query().

            Assignee:
            Unassigned Unassigned
            Reporter:
            alexander.stigsen@mongodb.com Alexander Stigsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: