Results 1 to 4 of 4

Thread: How to get value in formPanel using its ID ?

  1. #1
    Sencha User
    Join Date
    May 2010
    Location
    Jakarta - Indonesia
    Posts
    169

    Default How to get value in formPanel using its ID ?

    Hi All..,

    Is it possible to get values in formPanel using / based on its ID?

    so, I'm using :
    Code:
    var id = new newhid.core.rating.form().getId();
    getCmp(id).getValue(); // is it possible to do this to get the value?
    Or there is another way, to get the form values using its ID?

    Thanks..
    Berusaha dan Berdoa

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Is it the FormPanel or the Field that has the id?
    Code:
    var values = Ext.getCmp('id-of-formPanel').getForm().getFieldValues();
    var value = Ext.getCmp('id-of-field').getValue();
    var value = Ext.getCmp('id-of-formPanel').getForm().findField('name-of-field').getValue();

  3. #3
    Sencha User
    Join Date
    May 2010
    Location
    Jakarta - Indonesia
    Posts
    169

    Default

    Hi Condor..

    Thanks for your reply..
    The ID belongs to formPanel, and I want to use this ID for getting all values in it.

    I've tried to use this :
    Code:
    var values = Ext.getCmp('id-of-formPanel').getForm().getFieldValues();
    Here is my code :
    Code:
    var a = new newhid.core.vims_comp_group.form().getId();
    var values = Ext.getCmp(a).getForm().getFieldValues();
    console.log(values);
    But it shows error like this in firebug :
    Ext.getCmp(a).getForm().getFieldValues is not a function

    What am I missing?
    Berusaha dan Berdoa

  4. #4
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Older Ext versions didn't have a getFieldValues method. On these versions you will have to use getValues().

    The drawback of using getValues() is that you get the string values, even from number and date fields.

Similar Threads

  1. autoLoad in Formpanel destroys FormPanel? Weird behavior...
    By alexpetri in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 15 Jul 2010, 9:17 AM
  2. Replies: 0
    Last Post: 23 May 2010, 10:47 AM
  3. [FIXED-22] Prevent dropping of FormPanel in a FormPanel
    By ExtKD in forum Ext Designer: Bugs
    Replies: 1
    Last Post: 25 Mar 2010, 10:00 PM
  4. why formpanel have not scroll bar? if formpanel layout is absolute
    By kusoft.net in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 4 Mar 2008, 10:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •