admin管理员组

文章数量:1395451

What I try to achieve is something alike this:
Only then in a Sencha Touch application. I have achieved an input field with a button next to it but not a button inside of a input field.
Is there a way to get this functionality in Sencha Touch 2? (without using css to float the button above the input.

What I try to achieve is something alike this:
Only then in a Sencha Touch application. I have achieved an input field with a button next to it but not a button inside of a input field.
Is there a way to get this functionality in Sencha Touch 2? (without using css to float the button above the input.

Share Improve this question asked Apr 12, 2012 at 7:09 Rick HovingRick Hoving 3,5753 gold badges31 silver badges50 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

you can achieve this, let's try:

{
    xtype: 'textfield',
    ponent: {
      xtype: 'container', 
      layout: 'hbox', 
      items: [
      {
        xtype: 'textfield', 
        flex: 3,
      }, 
      {
        xtype: 'button', 
        flex: 1, 
        text: 'test'
      }
      ]},
},

Explanation: ponent is a special config for input fields and by default, it's set to {xtype: "input", type: "text"}, that's the key of this work-around. Scale your textfield vs button widths with flex config

Hope it helps. :)

本文标签: javascriptButton inside of an input field Sencha Touch 20Stack Overflow