1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    42
    Vote Rating
    0
    mnugter is on a distinguished road

      0  

    Default Combobox - default value

    Combobox - default value


    I use a remote dataset with a key=>value combobox. I got it working without much problems. The only thing I'm missing is to set a default value for the valueField AND the displayField. Is this not supported (yet) or am I just missing something?

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    What do you mean, when it's loaded? You can pass in a value: 'foo', or it will read an existing text field for its value, or if tranforming a select it will use the selects selected value. Is that not what you want?

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    42
    Vote Rating
    0
    mnugter is on a distinguished road

      0  

    Default


    I have a combobox with a JSON source. When the combobox loads there are no records available yet to the combobox. Also, I don't want to trigger a http-request just to fetch the default value.

    My combobox uses the hidden field to supply a key instead of the displayed value.

    To correctly set the default value I have to set both the display value and the hidden key value.

    EDIT:

    I just tried to add it to your code and it was actually very simple. I added the option hiddenValue and changed line 108 (was 107 before adding the hiddenValue option):

    Code:
                this.hiddenField.value = this.value;
    to

    Code:
                this.hiddenField.value = this.hiddenValue || this.value;

  4. #4
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    Ah, I can add that to the main source. It makes sense. Thanks.

  5. #5
    Ext User
    Join Date
    Mar 2007
    Posts
    42
    Vote Rating
    0
    mnugter is on a distinguished road

      0  

    Default


    No problem, and thank you for adding it to the main source

Similar Threads

  1. Ext.BasicLayoutRegion should have a default minSize
    By Animal in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 30 Mar 2007, 11:23 PM
  2. BorderLayout default panels
    By SteveEisner in forum Community Discussion
    Replies: 0
    Last Post: 12 Nov 2006, 11:58 PM

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