Results 1 to 2 of 2

Thread: In the modern toolkit, use the same data in multiple components with different filter

  1. #1
    Sencha User
    Join Date
    Jul 2018
    Posts
    3

    Default In the modern toolkit, use the same data in multiple components with different filter

    Well this is a thing that occurs quite often, I've always been wondering what is considered the "better" approach regarding sencha modern.

    What I have is a store containing all data, say simple models with `{name, age}` indication. Now the view consists of two components, each component (say a grid for now) shows a part of the store: grid A shows everyone age 18 and older, and B shows everyone age 21 and older.


    How would one do this?

    The most simple approach I have is in the init of some controller to dynamically create the new substores, where the data is copied to each store; which "works" but is both inefficient (lots of data) and error prone.

    The error becomes very apparent if I try to implement next feature: In both grids the age can be editted, and changes should of course be directly visible in the other stores. This part really becomes messy when using the approach of copying the stores, as now I have to add a handler in each component to update the age in the other stores.
    Thus each component needs to know about each other component making everything a tangled mess.

    So am I missing a feature? I feel I am.

  2. #2

    Default Chained store

    I have a store containing all the data then use chained stores with filters set for each subset of data needed for each control.

    Erik

Similar Threads

  1. Add filter to modern toolkit grid
    By akiroussama in forum Ext JS 6.x Q&A
    Replies: 6
    Last Post: 19 Feb 2019, 2:46 PM
  2. Replies: 0
    Last Post: 4 May 2018, 3:11 AM
  3. Modern Components in Classic Toolkit
    By hitman01 in forum Ext JS 6.x Q&A
    Replies: 3
    Last Post: 17 Aug 2017, 3:29 PM
  4. ??? Data Binding in the Ext JS Modern Toolkit
    By martini3oz in forum Sencha日本語フォーラム
    Replies: 0
    Last Post: 28 Oct 2015, 6:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •