Results 1 to 4 of 4

Thread: Reset file filed

  1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    40
    Answers
    1

    Default Answered: Reset file filed

    I'm using a file field in my application and I'm not able to show a clear icon near the file box or to reset the field when I reset the form. How can I do that?

    Thanks

  2. The clear icon doesn't work, I solved using this snippet

    Code:
    var campo = $('#reg_foto2 input');
    campo.wrap('<form>').closest('form').get(0).reset();
    campo.unwrap();
    Where file field settings are
    Code:
    var foto = {
    xtype: 'filefield',
    name: 'foto1',
    label: 'Foto #1',
    itemId: 'foto1',
    id: 'reg_foto1',
    labelAlign: 'top',
    flex: 1,
    accept: 'image'
    }

  3. #2
    Sencha User
    Join Date
    Mar 2013
    Posts
    40
    Answers
    1

    Default

    Up

  4. #3
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Have you configured clearIcon on your field?

  5. #4
    Sencha User
    Join Date
    Mar 2013
    Posts
    40
    Answers
    1

    Default

    The clear icon doesn't work, I solved using this snippet

    Code:
    var campo = $('#reg_foto2 input');
    campo.wrap('<form>').closest('form').get(0).reset();
    campo.unwrap();
    Where file field settings are
    Code:
    var foto = {
    xtype: 'filefield',
    name: 'foto1',
    label: 'Foto #1',
    itemId: 'foto1',
    id: 'reg_foto1',
    labelAlign: 'top',
    flex: 1,
    accept: 'image'
    }

Posting Permissions

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