Results 1 to 2 of 2

Thread: File upload button in toolbar

  1. #1
    Sencha User
    Join Date
    Mar 2010
    Location
    Moscow, Russia
    Posts
    24
    Vote Rating
    0
      0  

    Default File upload button in toolbar

    I want to put file upload button in a toolbar and make it look like other toolbar buttons.

    I made a formpanel and put it to a toolbar like regular item:
    Code:
    var file_form = Ext.create('Ext.form.FormPanel',{
            baseCls: ''
            ,width: 110
            ,items: [
               Ext.create('Ext.form.File', {
                    buttonOnly: true,
                    hideLabel: true,
                    buttonText: 'Upload'
                    ,buttonCfg: {
                        icon: '/images/icons/add.png'
                    }
                    ,name: 'img'
                    ,listeners: {
                        change: function(t,v){
                            // submit form
                        }
                    }
                })
           ]
        })
    What I get is a regular grey button in a toolbar. Uploading works fine.
    But in B3 buttonCfg does not make any changes - icon not appears (in B2 it worked).
    I tried to play with different classes in button config but all in vain.

    Any ideas how to make it look like toolbar button?

    Thanks.

  2. #2
    Sencha Premium Member Trevor4001's Avatar
    Join Date
    Sep 2013
    Posts
    85
    Vote Rating
    17
      0  

    Default

    I was able to workaround this in Ext JS 6.5.0.775 with the following configuration.
    Code:
    xtype: 'fileuploadfield',
    buttonConfig: {
        ui: 'default-toolbar'
    },
    buttonOnly: true
    Trevor Karjanis

Similar Threads

  1. File upload button displaying funky behaviour
    By kevin-berry in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 7 May 2010, 3:21 PM
  2. [FIXED][3.0rc1] File upload button issue
    By cfrerebeau in forum Ext 2.x: Bugs
    Replies: 1
    Last Post: 20 Apr 2009, 6:58 AM
  3. [FIXED][3.0rc1] File upload button issue
    By cfrerebeau in forum Ext 3.x: Bugs
    Replies: 1
    Last Post: 20 Apr 2009, 6:58 AM
  4. fUgly: Hacking toolbar dropdown menu to contain file view/upload functionality
    By ash.eldritch@gmail.com in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 30 Sep 2008, 4:12 AM
  5. show windows file upload dialog on click of toolbar button
    By rojar in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 26 Nov 2007, 3:45 AM

Posting Permissions

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