PDA

View Full Version : problem with spinnerfield



manish khamar
24 Aug 2011, 11:09 PM
hello everybody

I have one problem with spinnerfield.

I want that spinner increment and decrement only by press + and - button .
I do not want that user directly input value.

For that I set disableInput:true ,
But it's not working .
pls give me any suggestion.

code:
xtype:"spinnerfield",
name:"rad",
label:"Radius",
disableInput:true,
cycle:true,
value:1,
minValue:1,
maxValue:15

pls help me.

tomalex0
25 Aug 2011, 1:26 AM
Try this override


Ext.form.Spinner.override({
renderTpl: [
'<tpl if="label"><div class="x-form-label"><span>{label}</span></div></tpl>',
'<tpl if="fieldEl">',
'<div class="{componentCls}-body">',
'<div class="{componentCls}-down"><span>-</span></div>',
'<div class="x-form-field-container">',
'<input id="{inputId}" type="{type}" name="{name}" class="{fieldCls}"',
'<tpl if="tabIndex">tabIndex="{tabIndex}" </tpl>',
'<tpl if="placeHolder">placeholder="{placeHolder}" </tpl>',
'<tpl if="style">style="{style}" </tpl>',
'<tpl if="minValue != undefined">min="{minValue}" </tpl>',
'<tpl if="maxValue != undefined">max="{maxValue}" </tpl>',
'<tpl if="stepValue != undefined">step="{stepValue}" </tpl>',
'<tpl if="autoComplete">autocomplete="{autoComplete}" </tpl>',
'<tpl if="autoFocus">autofocus="{autoFocus}" </tpl>',
'<tpl if="disableInput">disabled="disabled" </tpl>',
'/>',
'<tpl if="useMask"><div class="x-field-mask"></div></tpl>',
'</div>',
'<div class="{componentCls}-up"><span>+</span></div>',
'</div>',
'</tpl>'
]
});

manish khamar
25 Aug 2011, 1:33 AM
thanks for reply it works properly:)