1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    14
    Vote Rating
    0
    mlourdes is on a distinguished road

      0  

    Default populate selectedField inside form with a nested store

    populate selectedField inside form with a nested store


    Hi ,
    I have a form with a selected field that I would like to edit .
    When loading the form the selected fields does not show the values that are already stored .
    I have two models


    Ext.define('app.model.mdcustomer', {
    extend: 'Ext.data.Model',
    alias: 'model.md',


    uses: [
    'app.model.mdvendorToSite'
    ],


    config: {
    hasOne: {
    associationKey: '',
    model: 'app.model.mdvendorToSite',
    primaryKey: 'siteId',
    getterName: 'getSite',
    foreignKey: 'vendorToSite_id',
    setterName: 'setSite'
    },
    fields: [
    {
    name: 'vendorToSite_id',
    type: 'int'
    },
    {
    name: 'account',
    type: 'string'
    },...

    extend: 'Ext.data.Model',


    config: {
    idProperty: 'siteId',
    fields: [
    {
    name: 'site',
    type: 'string'
    },
    {
    name: 'siteId',
    type: 'int'
    }
    ],
    proxy: {
    type: 'ajax',
    url: 'Data/VendorToSite.json',
    reader: {
    type: 'json',
    rootProperty: 'vendorToSite'
    }
    }
    }
    });

    I want to show in a form "customer" , the right value in selected field

    {
    xtype: 'selectfield',
    width: '50%',
    label: 'Vendor To Site',
    labelAlign: 'top',
    displayField: 'site',
    store: 'st_VendorToSite',
    valueField: 'siteId'
    }

    I am loading the form like :
    frmEdit.setRecord(storeCustomer.getAt(0));

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,176
    Vote Rating
    119
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Are both of the other stores (st_VendorToSite for example) already loaded before you invoke setRecord?
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    14
    Vote Rating
    0
    mlourdes is on a distinguished road

      0  

    Default Selected field in editable Form

    Selected field in editable Form


    It was solved , I have associations foreign key , primary key disagreement , and the most important thing the property name in my select control (by default "picker"), I was paying attention to the Id.

  4. #4
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,176
    Vote Rating
    119
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Glad, you got it.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi