Results 1 to 4 of 4

Thread: How to chain combo with viewModel stores

  1. #1
    Sencha Premium Member
    Join Date
    Mar 2013
    Posts
    14

    Default Answered: How to chain combo with viewModel stores

    Hi,

    i am trying chain comboboxes with references as sencha examples do in:
    http://dev.sencha.com/extjs/5.0.0/ex...combo-chaining

    When i add the filter config on second combo we recive the error:
    Cannot read property 'getFilters' of undefined

    A fiddle with the problem:

    https://fiddle.sencha.com/#fiddle/983

    Could the store type generate the problem?

  2. Hi

    One solution is to move the filters config to the store.
    This examples uses a selection binding instead of a reference:
    https://fiddle.sencha.com/#fiddle/98e

    Or you add the filters config to the combobox (same as the kitchensink example).
    But it has to be inside the bind object.

    Code:
    xtype: 'combo',
    bind: {
      store: '{fooStore}',
      filters: {
         property: 'bar',
         value: '{selectedBar.value}'
       }
    },
    Ralph

  3. #2
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    144
    Answers
    4

    Default

    Hi

    One solution is to move the filters config to the store.
    This examples uses a selection binding instead of a reference:
    https://fiddle.sencha.com/#fiddle/98e

    Or you add the filters config to the combobox (same as the kitchensink example).
    But it has to be inside the bind object.

    Code:
    xtype: 'combo',
    bind: {
      store: '{fooStore}',
      filters: {
         property: 'bar',
         value: '{selectedBar.value}'
       }
    },
    Ralph

  4. #3
    Sencha Premium Member
    Join Date
    Mar 2013
    Posts
    14

    Default

    Bind filter was the solution.

    Thanks a lot Ralph!

  5. #4
    Sencha User razvanioan's Avatar
    Join Date
    Feb 2008
    Location
    Romania
    Posts
    135
    Answers
    4

    Default

    but doing so, the child combo get's filtered on every parent combo change, even if the user types characters (filters) and thus the returned value of the parent isn't a valid ID, but a string (typed) ...

    is there a way to avoid supplementary (unnecessary) server callbacks (if child combo is remote filter) ?
    ---
    Razvan Ioan ANASTASESCU
    Senior WEB Developer

Posting Permissions

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