Results 1 to 6 of 6

Thread: Combobox without dropdown and sizing NumberBox?

  1. #1
    Ext User violinista's Avatar
    Join Date
    Apr 2007
    Location
    Serbia
    Posts
    293

    Default Combobox without dropdown and sizing NumberBox?

    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 but for my special issue there is no need to paste anything, since my numberBox must be exactly 3 character wide?

    I tried:
    Code:
    	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!!

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    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.
    Code:
    myNumberField.getEl().dom.maxLength=3;

  3. #3
    Ext Premium Member
    Join Date
    Mar 2007
    Posts
    175

    Default

    I haven't tried this, but isn't that what the "trigger" config option is for?

  4. #4
    Ext User violinista's Avatar
    Join Date
    Apr 2007
    Location
    Serbia
    Posts
    293

    Default

    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...

  5. #5

    Default

    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?

  6. #6
    Ext User violinista's Avatar
    Join Date
    Apr 2007
    Location
    Serbia
    Posts
    293

    Default

    Thank you, I've solved my specific problem in other way.

    Greetz 2 all!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •