1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    36
    Vote Rating
    1
    Answers
    2
    Srikanth474 is on a distinguished road

      0  

    Default Unanswered: + before textbox of numberfield

    Unanswered: + before textbox of numberfield


    Hello,

    I have a form which has multiple number fields, some of them will be added to total and some of them will be subtracted from total. i need to display a + or - right before where the textbox starts.

    fieldLabel : +[textbox]

    Any Suggession.


    Thanks & Regards
    Srikanth

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,714
    Vote Rating
    438
    Answers
    3113
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Change the fieldSubTpl
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    36
    Vote Rating
    1
    Answers
    2
    Srikanth474 is on a distinguished road

      0  

    Default


    Hi,
    Thanks for the reply i tried to change fieldSubTpl, but having trouble figuring out how to do it. the textfield is not rendering properly.
    this is what i am trying to do in the fieldSubTpl

    {
    xtype:'textfield',
    fieldLabel : 'testing',
    fieldSubTpl: [ // note: {id} here is really {inputId}, but {cmpId} is available
    '<span>+<input id="{id}" type="{type}" ',
    '<tpl if="name">name="{name}" </tpl>',
    '<tpl if="size">size="{size}" </tpl>',
    '<tpl if="tabIdx">tabIndex="{tabIdx}" </tpl>',
    'class="{fieldCls} {typeCls}" autocomplete="off" /></span>',
    {
    compiled: true,
    disableFormats: true
    }
    ],
    },

    Problem is the textbox is going in to next line.
    screenshot:


    i see the same with the below
    {
    xtype:'textfield',
    fieldLabel : 'testing',
    autoEl: {tag: 'span', html: '+'},
    },



    Untitled.jpg
    Last edited by Srikanth474; 2 Apr 2012 at 6:24 AM. Reason: Screenshot was not showing

  4. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    36
    Vote Rating
    1
    Answers
    2
    Srikanth474 is on a distinguished road

      0  

    Default


    Does any one have idea on how to do this.

    Thanks
    Srikanth

Tags for this Thread