ng2-select with children not working in 1.2.0

Created on 5 Apr 2017  ·  4Comments  ·  Source: valor-software/ng2-select

Hi All,

In my application ng2-select does not show any suggestions when i'm using grouped data. I know that my syntax is correct, because without changing anything in my code it works fine when I install version 1.1.2.

Anyone else experiencing this? If so, as I mentioned, downgrading to 1.1.2 worked for me. If anyone knows what I could be missing or has a solution I'd like to hear!

Thanks in advance!

Most helpful comment

Newer version requires id of parent, so set and it will work.
e.g.

  
public items:Array<any> = [
    {
      id: 1,
      text: 'India',
      children: [
        {id: 54, text: 'Mumbai'}
      ]
    },
    {
      id: 2,
      text: 'USA',
      children: [
        {id: 2, text: 'New York'},
        {id: 9, text: 'Washington DC'}
      ]
    }
    ]
  

All 4 comments

Looks like it doesn't work on their site either http://valor-software.com/ng2-select/

Newer version requires id of parent, so set and it will work.
e.g.

  
public items:Array<any> = [
    {
      id: 1,
      text: 'India',
      children: [
        {id: 54, text: 'Mumbai'}
      ]
    },
    {
      id: 2,
      text: 'USA',
      children: [
        {id: 2, text: 'New York'},
        {id: 9, text: 'Washington DC'}
      ]
    }
    ]
  

Adding ID to the elements did solve the issue as @shahjay748 wrote. Thank you!

Here dont work even with id

Was this page helpful?
0 / 5 - 0 ratings

Related issues

253936563 picture 253936563  ·  5Comments

jay-perera picture jay-perera  ·  6Comments

Cadenei picture Cadenei  ·  4Comments

bissolli picture bissolli  ·  6Comments

jenb34 picture jenb34  ·  5Comments