Results 1 to 5 of 5

Thread: Display a form fieldlabel as a button ???

  1. #1

    Question Display a form fieldlabel as a button ???

    Hi everybody,

    Does anyone know how could i display a form fieldlabel as a button ?

    i think i would need to overwrite the template in Ext.layout.Formlayout.SetContainer function

    var t = new Ext.Template(
    '<div class="x-form-item {5}" tabIndex="-1">',
    '<label for="{0}" style="{2}" class="x-form-item-label">{1}{4}</label>',
    '<div class="x-form-element" id="x-form-el-{0}" style="{3}">',
    '</div>',
    '</div><div class="{6}"></div>'
    );

    and replace the label with a div but i have no idea on how can i do this ??

    anyone here know how ??

    thanks a lot

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

    Default

    Do you really want the Ext.Button style, or just a visual feedback that you can click on the label?

    The second one is easier:

    Leave the template as it is and after render use addClassOnOver and addClassOnClick on the x-form-item-label and add a click handler.

  3. #3

    Default

    Once more condor is flying to our rescue, thanks for the tips condor.

    But !!!!

    Yes i really want a button layout. If you already used outlook you'll see in the contact form that there's some fieldlabel where you can select phone1 phone2 phone3 ....... and once you selected the fieldlabel button the phone appear in the same textfield.

    That's exactly what i want !!!

    So i need the harder solution !!!

    Any idea ??

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

    Default

    Why not use a column or table layout and include buttons and textfields (without fieldLabels) ?

  5. #5

    Default

    Waouuu what a quick answer !!!

    you're right that's what i'll do in a first time.

    But it i think it could be great for the Lib to have one option in fields that allow someone to do it like for example FieldLabelType. One day when i'll grow up i'll do it that way. Right now as i'm still a baby in the javascript world i'll do it the way you told me condor.

    Thanks a lot

Posting Permissions

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