lundi 23 octobre 2017

Ember Powerselect data format

I am looking the documentation of the format of the how it needs to be. But I am wondering how I could add the id of the options.

groupedNumbers: [
    { groupName: 'Smalls', options: ['one', 'two', 'three'] },
    { groupName: 'Mediums', options: ['four', 'five', 'six'] },
    { groupName: 'Bigs', options: [
        { groupName: 'Fairly big', options: ['seven', 'eight', 'nine'] },
        { groupName: 'Really big', options: [ 'ten', 'eleven', 'twelve' ] },
        'thirteen'
      ]
    },
    'one hundred',
    'one thousand'
  ]

Here is what I am looking to do

groupedNumbers: [
    { groupName: 'Smalls', options: [{
        id: 1,
        name: 'one'
    },
    {
        id: 2,
        name: 'two'
    }]
  ]

I thought I could override the optionsComponent but that did not work. Thoughts?




Aucun commentaire:

Enregistrer un commentaire