[CLOSED] FileUploadField with Scale

  1. #1

    [CLOSED] FileUploadField with Scale

    Hi

    Is this an Ext.Net issue?

    Using the Scale property on the FileUploadField control results in cls "x-btn-default-toolbar-small" being rendered out on child items. Width properties are also set too small directly on elements.

    Thanks
    Glen
    Last edited by Daniil; Jul 17, 2015 at 3:37 PM. Reason: [CLOSED]
  2. #2
    Ok - just noticed that this is not a config setting for FileUpload.

    I have a FileUploadField in a toolbar where all buttons are set to scale Medium. Is there a way to set the FileUpload button to be similar to Scale Medium. By default it sets cls to small and writes width properties directly to element so it's a bit hard to override css?

    Thanks
    Glen
  3. #3
    In case some one wants to do the same thing...I have override the onRender property.

    Notice I've added the Scale config when creating the FileButton class.

    Ext.form.field.File.override({
            onRender: function() {
                var me = this,
                id = me.id,
                inputEl;
    
    
                me.callParent(arguments);
    
    
                inputEl = me.inputEl;
                inputEl.dom.name = ''; //name goes on the fileInput, not the text input
    
    
                // render the button here. This isn't ideal, however it will be 
                // rendered before layouts are resumed, also we modify the DOM
                // below anyway
                me.button = new Ext.form.field.FileButton(Ext.apply({
                    renderTo: id + '-browseButtonWrap',
                    ownerCt: me,
                    ownerLayout: me.componentLayout,
                    id: id + '-button',
                    ui: me.ui,
                    disabled: me.disabled,
                    text: me.buttonText,
                    scale: 'medium',
                    style: me.buttonOnly ? '' : me.getButtonMarginProp() + me.buttonMargin + 'px',
                    inputName: me.getName(),
                    listeners: {
                        scope: me,
                        change: me.onFileChange
                    }
                }, me.buttonConfig));
                me.fileInputEl = me.button.fileInputEl;
    
    
                if (me.buttonOnly) {
                    me.inputCell.setDisplayed(false);
                    me.shrinkWrap = 3;
                }
    
    
                // Ensure the trigger cell is sized correctly upon render
                me.browseButtonWrap.dom.style.width = (me.browseButtonWrap.dom.lastChild.offsetWidth + me.button.getEl().getMargin('lr')) + 'px';
                if (Ext.isIE) {
                    me.button.getEl().repaint();
                }
            }
        });
  4. #4
    Hi @glenh,

    Maybe, you are looking for this:
    <ext:FileUploadField runat="server">
        <Button Scale="Medium" />
    </ext:FileUploadField>

Similar Threads

  1. Replies: 10
    Last Post: Sep 20, 2017, 2:31 AM
  2. [FIXED] [#741] [3.2.0] Set scale
    By RCN in forum Bugs
    Replies: 3
    Last Post: Mar 04, 2015, 12:22 PM
  3. Replies: 4
    Last Post: Mar 18, 2014, 4:04 AM
  4. Replies: 3
    Last Post: Jul 13, 2012, 10:28 AM
  5. [CLOSED] Button Scale? What does it do?
    By wagger in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 07, 2011, 7:38 PM

Posting Permissions