1. #1
    Ext User
    Join Date
    Apr 2008
    Vote Rating
    psambhus is on a distinguished road


    Question Store valueField and displayField

    Store valueField and displayField

    Hi all ,

    i want to know the basic difference between the valueField and displayField in the store and how can i use them.
    any example would be appreciated.

    Thanks in advance .....

  2. #2
    Ext JS Premium Member
    Join Date
    Nov 2007
    Vote Rating
    sigaref is on a distinguished road



    I know valueField and displayField especially from comboboxes.

    You could have a combobox linked to the following data:

    {countrycode: 'IT', countryname: 'Italy'},
    {countrycode: 'DE', countryname: 'Germany'},
    {countrycode: 'AT', countryname: 'Austria'},
    {countrycode: 'UK', countryname: 'United Kingdom'}

    In your combobox you have on field which should be display both in the dropdown and in the "no-dropdown" view. In this case the fieldname is "countryname", because you probably want the names Italy, Germany, ... to be visible, so when initializing the combobox you should specify displayField: "countryname".

    On the other hand you want to retrieve a value for the selected item, in this case probably it is better to work with the countrycode instead of the name, that means if you have selected "Italy" you want to get "IT" when calling the combobox's getValue() method. For this case set valueField: "countrycode".

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar