1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    11
    Vote Rating
    0
    deamon1767 is on a distinguished road

      0  

    Default Loadin data to a form

    Loadin data to a form


    Stupid question I hope
    I have for example
    {
    xtype: 'displayfield',
    maxHeight: 25,
    maxWidth: 320,
    name: 'maint_address',
    value: 'J Technics\n',
    fieldLabel: 'Account Name and Address',
    labelAlign: 'top',
    flex: 1
    },

    I have the store created and am using a direct proxy (data is loading but not showing on form)
    How do I get the field to display the data?

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,413
    Vote Rating
    129
    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


    The form panel you will want to invoke setRecord (in touch) or loadRecord (in Ext).

    Touch has standardized the API to use get/set for everything. loadRecord will probably be changing to setRecord in the next major version of Ext.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    11
    Vote Rating
    0
    deamon1767 is on a distinguished road

      0  

    Default From inside designer

    From inside designer


    I think I understand, kindof but am doing my coding inside extdesigner
    Can you give me an example/walkthru please

  4. #4
    Sencha User
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
    m1santrophy is on a distinguished road

      0  

    Default same issue here

    same issue here


    i've put this listener on itemclick(treepanel)

    Code:
    var view = Ext.widget('panelExplorer');
    view.down('form').loadRecord(record);
    var dispId = view.down('form').getComponent('lblId');//this is the display field
    console.log(dispId.getValue());
    this is the config for displayfield
    Code:
     xtype: 'form', height: 150,
     title: 'SIP Summary',
     items: [
     {
            xtype: 'displayfield',
             itemId: 'tblId',
             name: 'id',
             fieldLabel: 'Total Collection',
             labelWidth: 125
       },
       {
            xtype: 'displayfield',
            itemId: 'lblType',
            name: 'type',
            fieldLabel: 'Total Deliverable Units',
            labelWidth: 125
        },
        {
            xtype: 'displayfield',
            itemId: 'lblTitle',
            name: 'title',
            fieldLabel: 'Total Files',
            labelWidth: 125
         }
                                ]
    Each of displayfield's name has been set according to the field on my store config.

    So by logic each click on the node the displayfield will display its details(node) .
    But on the UI the display field not render anything, while on console it show the exact data that return from the action.

    below is the screen capture:

    1st time application load
    Attachment 34822

    when item(node) is being click the itemclick event will be fired.But the displayfield (on Display Panel) does not render anything.
    Attachment 34823

    while on console it display the displayfield value(i'm using getValue() method)
    Attachment 34824
    sorry for my bad English can someone help?

  5. #5
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,413
    Vote Rating
    129
    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


    Do the names of the form fields match the names of the data fields?
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  6. #6
    Sencha User
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
    m1santrophy is on a distinguished road

      0  

    Default


    yes..even I try to set the field value manually using .setValue() method it still not rendered on UI but by console it show the value that I've set.

    ....Problem Solve.....
    i've set up a new ref which select the the field form panel
    and setValue manually.
    thanks for your help

Thread Participants: 2