Hybrid View

  1. #1
    Ext User
    Join Date
    Jan 2009
    Posts
    132
    Vote Rating
    0
    ald_2008 is on a distinguished road

      0  

    Question how to Reset Fileupload input?

    how to Reset Fileupload input?


    Hi There,
    How do you reset file input value?? I have a dialog with a form and file input field. The first upload works, then open the dialog again the input text is the path of the old file. I can clear it out with setValue(''), but when I browse to a new file and try to upload, the first file gets uploaded.
    And .setValue("") works in FF only in IE it says that does not support this object or property.

    Can anyone help me , please???

    Thanks

  2. #2
    Ext User zhegwood's Avatar
    Join Date
    Dec 2007
    Location
    Boulder, CO Suburbia (Lafayette)
    Posts
    388
    Vote Rating
    1
    zhegwood is on a distinguished road

      0  

    Default


    You need to delete and re-create it... At least that's what I did when I ran into this problem. a while back.

  3. #3
    Ext User
    Join Date
    Jan 2009
    Posts
    132
    Vote Rating
    0
    ald_2008 is on a distinguished road

      0  

    Default


    Hey
    Thanks for your reply,
    How did you delete and recreate it?
    Could you give me sample code?

    Thanks a lot

  4. #4
    Ext User zhegwood's Avatar
    Join Date
    Dec 2007
    Location
    Boulder, CO Suburbia (Lafayette)
    Posts
    388
    Vote Rating
    1
    zhegwood is on a distinguished road

      0  

    Post


    There are a bunch of ways, but you could do this every time you needed a new one:

    Code:
    function buildFileInput() {
        if (this.fileInput) {
            delete(this.fileInput);
        }
        this.fileInput = new Ext.Component({
            autoEl: {
                tag: 'input',
                type: 'file',
                name: 'fileinput'
            }
        });
    }

  5. #5
    Ext User
    Join Date
    Jan 2009
    Posts
    132
    Vote Rating
    0
    ald_2008 is on a distinguished road

      0  

    Default


    i see. Thanks..
    But thing is mine is not exactly file input..I am using fileuploadfield, and when i debug, i can see under it's properties, there is a fileInput property which still has the path of the file last time selected:
    Code:
    {
                xtype: 'fileuploadfield',
                id: 'upload-file',
                emptyText: 'Select a file',
                fieldLabel: 'File Name',           
                allowBlank: false,            
                buttonCfg: {
                    text: '',
                    iconCls: 'upload-icon',
                    id:'uploadbtn'
                }
    Any idea?

  6. #6
    Ext User zhegwood's Avatar
    Join Date
    Dec 2007
    Location
    Boulder, CO Suburbia (Lafayette)
    Posts
    388
    Vote Rating
    1
    zhegwood is on a distinguished road

      0  

    Default


    I've never used the file upload field, but it looks like it's built with x-form-file-text (text field that displays the path) and x-form-file (the actual file input) and a button.

    I'm not sure it would be the best way to do it, but I'd probably get the parent node of 'x-form-file' and call parentNode.replaceChild(file input dom obj,new file input dom obj); Someone else may be able to come up with a more 'Ext-ish' way of doing it though.

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi