PDA

View Full Version : + before textbox of numberfield



Srikanth474
29 Mar 2012, 12:22 PM
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

mitchellsimoens
30 Mar 2012, 8:50 AM
Change the fieldSubTpl

Srikanth474
2 Apr 2012, 6:23 AM
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:
http://www.sencha.com/forum/image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI8AAAAnCAIAAAC5ToxHAAABmklEQVR4nO2YS26DMBCGfQROwcLX4Aw+D/fxeVh3U6nrSihCKA93gSGMTWTclsAM/6dZxMa2zHzxI1EO8EHtPQGQgRhbTa2V0nWz9zw2BbY4kbZljVJKGZs9dNCxqfUvB1oFbDnn/s/WNvjvQIhQbQlbUTKMDWpHG4ObqXKh42RveKaNGZs8c0tGmZ6s8Y615ZyLUzXkemZN1830wTcwdqFjYCs2QfbK+ZCw5cm2RYpjwS8JmqyEradbXyDVQSkNbDnnXtgKtyu68S2viJQt2j7X1in429p60XhI8nvX1ilI2wrTFpSbWhtrDU0yPdV8x5Qt38DXzwtvuV1yYM2v4+gKGFz4pnNrvg/GHZO2SAet824Zp+Co/2Ws2wiLqhQc8fseyha9waw4s4qq/Pj8EhnHt5VNUZXfbSsyZNpqLxeRIdPWpetEhkxbXd+LDJm2+utVZMi0dbvdRYZMW/fHQ2TItLX3FLYCtjgBW5yALU7AFidgixOwxQnY4gRscQK2OAFbnIAtTsi0JTji9+Vt62zAFidgixOwxYkfPnyUvjt7xV8AAAAASUVORK5CYII=

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

http://www.sencha.com/forum/image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJkAAAApCAIAAACp9ByYAAABm0lEQVR4nO2Yy22EMBRFXQJVsHAb1OB66Mf1sM4mUtaR0Aih+SQLDIMNMxjCJ9x3j94CGz8LfPBHqB+Cgjr6Achq0CUOdIkDtssi10rpvDj6OfaBLnFY6NIapZQy9q+JRa4XdhQFXUawlsttcF9ICLrUJS4HQ2VsUNu6asx1lSOJndvmnjambfIcea+X7k7MV8F5GUE4kI2JnlOdF92Fa2DsSGLgcujJW4X7XdJlyDouvWJbcNPJH8oJl0/zruBVB6Vp6DKCUZfhQugvqeOzacql336uS1lsMC9fNG4U7DsvZbHQZTioQbnItbHW+Ar83dQlTrl0DVx9v7DLifhULP5XMDi2BofUbr/sr7DDxEmXXoLW884+sjjVf5+4JTbJUuB48+L/36V/rorYK5Ms/fj8goyzu5xNkqXfZQkZEl2WlwtkSHR5qSrIkOiyqmvIkOiyvl4hQ6LL2+0OGRJd3h8PyJDo8uhH2Aq6xIEucaBLHOgSB7rEgS5xoEsc6BIHusSBLnGgSxwkugSONy8O6FIsdIkDXeJAlzj8AnzrtQ63AakaAAAAAElFTkSuQmCC

http://www.sencha.com/forum/image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJQAAAAnCAIAAABmAPZYAAABmUlEQVR4nO2YS26DMBBAfQROwcLX4Aw+D/fxebzuplLXlRBCKJ92gTGMcWSchtD5PM0iNrYD8/AnUT8CWtTZNyA8j8hDjMhDDEl5rtVK6dadfR9HI/IQUybPGqWUMrb4a6KOrtVPDrQLkZfiVfKOwb8SMXQtFsjb5MbYqHaWM6kKlYmOQeZ0TRszN1lSDUYJV/a8BjLzUsSZm1K/kqhbFz74BsYmOkbytmLAwroeUuQt/EkeKM4FP2Fg7jLyFtW+AKqjUh6RlyIpL17b4CqZni85ebB9qTwuvG7mPWg85fy9M48LZfLiLEZl12pjrYE5hzui75iT5xv4+nXhLedWJJT+SN8cLqOjZNjz1ovmtmNWHuigddmBhQsY/mHZt2pWTU04ko/8b+XBw9CO/a5q6o/PL5KBTl4xVVN/dx3JYCGv63uSwUJePwwkg4W8YRxJBgt54+VCMljIu15vJIOFvNv9TjJYyDv7Fo5C5CFG5CFG5CFG5CFG5CFG5CFG5CFG5CFG5CFG5CFG5CGGhTzCkXxkOvIYIvIQ8wsib9uTJvybOgAAAABJRU5ErkJggg==33460

Srikanth474
13 Apr 2012, 2:52 PM
Does any one have idea on how to do this.

Thanks
Srikanth