Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: fieldLabel doesnt show up for ComboBox

  1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    15
    Vote Rating
    0
      0  

    Default fieldLabel doesnt show up for ComboBox

    I posted this in the wrong forum a minute ago but its a 2.x problem.

    I can't get the field label to show up for a combobox I am putting on a toolbar. Here is the code to create the ComboBox...

    Code:
    var findCombo = new Ext.form.ComboBox({
    store: findStore,
    displayField:'type',
    valueField: 'abbr',
    fieldLabel: 'Search by',
    mode: 'local',
    triggerAction: 'all',
    editable: false,
    width:90
    });any ideas?

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    85
      0  

    Default

    Field label only shows up for formpanels.

  3. #3
    Sencha User catacaustic's Avatar
    Join Date
    Jul 2007
    Location
    "A Land Down Under"
    Posts
    618
    Vote Rating
    1
      0  

    Default

    To be able to put a "label" on a ComboBox, or any other form field, that's in a Toolbar, you need to add the text in separately.
    Code:
    vat tb = new Ext.Toolbar ({
      items: [
        new Ext.Toolbar.TextItem ("Field Label:"), 
        new Ext.form.TextField ({width: 100})
      ]
    });
    'Once again, fortune vomits on my eiderdown'
    - Edmund Blackadder

  4. #4
    Ext User
    Join Date
    Mar 2007
    Posts
    15
    Vote Rating
    0
      0  

    Default

    Thank you cat, that is exactly what I needed.

  5. #5
    Ext User
    Join Date
    Oct 2007
    Posts
    15
    Vote Rating
    0
      0  

    Default

    labels are visible only in formpanels... but why?
    in a toolbar i'd like to put a field with its label, i don't want to use a separate text because I want to click on the label and give focus to the field

    think it's pretty important

  6. #6
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    85
      0  

    Default

    If you are building the combo box, it's easy to create a label to the left/right of it. I only use field labels in formpanels. The labelWidth attribute is only honored by the formpanel. If you are using a combo box and are setting the width to 100px, the combo box is 100px. if you are looking to add a field label automagically, how can you ask ext to make the combo box 100px? it would be either less than 100px + the text width OR 100px + the text width.

    Either way, I feel that EXT's design in this case is 100% correct.

  7. #7
    Ext User
    Join Date
    Oct 2007
    Posts
    15
    Vote Rating
    0
      0  

    Default

    i can't really see the width problem, it could be managed in the same way of the formpanel

    i'm just wondering why i can't have a real field label for a field in a toolbar, it does not make sense to me

  8. #8
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    85
      0  

    Default

    you can just add text as part of an HTML fragment. I don't see the issue.

  9. #9
    Ext User
    Join Date
    Oct 2007
    Posts
    15
    Vote Rating
    0
      0  

    Default

    the issue is
    when you click on a real label you get the field focused
    it doesn't happen on a fake label

    and anyway it would be much more coherent to me

  10. #10
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    85
      0  

    Default

    That is true. To achieve this effect takes only a few lines of code. If you feel that strongly about this - buy a license and request this feature.

Page 1 of 2 12 LastLast

Posting Permissions

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