2014-09-16 3 views
0

Voici le fiddlePopulate données Cascading dans combobox

J'ai essayé de chercher le problème que j'ai, mais je ne pouvais pas trouver quelque chose d'utile.

J'ai un magasin comme:

var store = Ext.create('Ext.data.Store', { 
storeId: 'employeeStore', 
model: 'User', 
groupField: 'CRDS', 
autoLoad: true, 
data: { 
    'employees': [{ 
     "CRDS": "ABBCAMS", 
     "SelBg": "TEST1", 
     "ALLBGs": [{ 
      "ID": 10, 
      "BG": "TEST1" 
     }, { 
      "ID": 20, 
      "BG": "TEST2" 
     }, { 
      "ID": 30, 
      "BG": "TEST3" 
     }], 
     "excl": 1, 
     "unlc_acc": 0, 
     "susp_acc": 0, 
     "blck_acc": 0, 
     "agency": 0, 
     "tryimg": "img/trend-down.png" 
    }, { 
     "CRDS": "ABBCAMS", 
     "SelBg": "TEST4", 
     "ALLBGs": [{ 
      "ID": 10, 
      "BG": "TEST1" 
     }, { 
      "ID": 20, 
      "BG": "TEST2" 
     }, { 
      "ID": 30, 
      "BG": "TEST3" 
     }], 
     "excl": 1, 
     "unlc_acc": 0, 
     "susp_acc": 0, 
     "blck_acc": 0, 
     "agency": 0, 
     "tryimg": "img/trend-down.png" 
    }, { 
     "CRDS": "BARCLON", 
     "SelBg": "TEST7", 
     "ALLBGs": [{ 
      "ID": 10, 
      "BG": "TEST1" 
     }], 
     "excl": 0, 
     "unlc_acc": 1, 
     "susp_acc": 1, 
     "blck_acc": 1, 
     "agency": 1, 
     "tryimg": "img/trend-down.png" 
    }, { 
     "CRDS": "SOGEPAR", 
     "SelBg": "TEST9", 
     "ALLBGs": [{ 
      "ID": 10, 
      "BG": "TEST1" 
     }, { 
      "ID": 20, 
      "BG": "TEST2" 
     }, { 
      "ID": 30, 
      "BG": "TEST3" 
     }], 
     "excl": 0, 
     "unlc_acc": 1, 
     "susp_acc": 1, 
     "blck_acc": 1, 
     "agency": 1, 
     "tryimg": "img/trend-down.png" 
    }, { 
     "CRDS": "CRITGOA", 
     "SelBg": "TEST3", 
     "ALLBGs": [{ 
      "ID": 10, 
      "BG": "TEST1" 
     }, { 
      "ID": 20, 
      "BG": "TEST2" 
     }, { 
      "ID": 30, 
      "BG": "TEST3" 
     }], 
     "excl": 0, 
     "unlc_acc": 1, 
     "susp_acc": 1, 
     "blck_acc": 1, 
     "agency": 1, 
     "tryimg": "img/trend-down.png" 
    }] 
} 
}); 

Je veux être en mesure de charger ALLBGs sous-ensemble dans une zone de liste. Je ne suis pas capable de comprendre comment s'y prendre. Voici ce que je ATM:

xtype: 'grid', 
columns: [ 
    { 
     text: 'GCL ORG ID', 
     dataIndex: 'SelBg', 
     renderer: function(store, record, rowIndex, value) {return Ext.getStore('employeeStore').data.items[value].data.SelBg;}, 
     editor: new Ext.form.field.ComboBox({ 
      id: 'bg1', 
      typeAhead: true, 
      triggerAction: 'all', 
      selectOnTab: true, 
      displayField: 'BG', 
      valueField:'ID', 
      // NEED DYNAMIC STORE ALLBGs HERE 
      store: [ 
       ['Shade','ABCD'], 
       ['Mostly Shady','Mostly Shady'], 
       ['Sun or Shade','Sun or Shade'], 
       ['Mostly Sunny','Mostly Sunny'], 
       ['Sunny','Sunny'] 
      ], 
      lazyRender: true, 
      listClass: 'x-combo-list-big' 
     }) 
    } 

Merci, Rencontrez

Répondre

0

j'ai pu le faire en créant magasin au moment de l'exécution. Pour référence, j'ai appliqué les mêmes changements dans fiddle également.

+0

Je vais attendre quelqu'un qui a une meilleure idée que le mien. Fermera dans 2 jours. – Meet