PDA

View Full Version : Combobox without dropdown and sizing NumberBox?



violinista
25 May 2007, 6:20 AM
Hello to all,

1. Is there a way to completely hide dropdown from showing when user types in combo (except "hard way": setting class to "visible:none")?

2. How can I limit the size of TextBox/Number box? I saw this thread (http://extjs.com/forum/showthread.php?t=5329&highlight=maxlength) but for my special issue there is no need to paste anything, since my numberBox must be exactly 3 character wide?

I tried:


var myNumberField = new Ext.form.NumberField({
fieldLabel: 'Code',
name: 'Code',
emptyText:'Code',
maxLength:3,
minLength:3,
allowBlank:false,
allowNegative:false,
allowDecimals:false
});

myFrm.add(myNumberField);
myFrm.render('frmTest');

Ext.get(txtLeaCode.el).dom.size=3;


...but unfortunately HTML INPUT element does not receive parameter 'size=3'. What am I doing wrong?

This two problems are connected with one special numberBox which I need, with validating from database and putting results live into the document.

10x all in advance, great extJS team!!

tryanDLS
25 May 2007, 7:34 AM
1. I don't know that there is a way to do it other than CSS - visible or height.

2. Like that other thread says, the maxLength config property is used a validator rule, not a property of the input tag. You could still do it by adding the value to the dom node.

myNumberField.getEl().dom.maxLength=3;

SteveEisner
25 May 2007, 8:06 AM
I haven't tried this, but isn't that what the "trigger" config option is for?

violinista
27 May 2007, 10:06 PM
Thank you about a tip for "maxLength"!

"Trigger" option is for displaying trigger button in trigger field (default: down arrow).

Still searching for valid way to hide dropdown list...

liggett78
28 May 2007, 12:15 AM
1. maybe you can try to set minChars to a reasonably big number, so the dropdown will never show. There is also "beforequery" event that can cancel expanding. Is that what you're trying to accomplish?

violinista
28 May 2007, 5:08 AM
Thank you, I've solved my specific problem in other way.

Greetz 2 all!