title: Accept Image in Filefield ExtJs
body: <p>I have a filefield componente in my application and I want to restrict it to only image files. I've found this question on stackoverflow:</p>
  
  <p><a href="https://stackoverflow.com/questions/12948793/how-to-restrict-file-type-using-xtype-filefieldextjs-4-1-0">How to restrict file type using xtype filefield(extjs 4.1.0)?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/14317777/add-accept-image-attribute-to-input-field-in-extjs">Add accept=&quot;image/*&quot; attribute to input field in ExtJs</a></p>
  
  <p>I'm using this code:</p>
  
  <pre><code>{
    xtype:'filefield',
    listeners:{
      afterrender:function(cmp){
        cmp.fileInputEl.set({
          accept:'audio/*'
        });
      }
    }
  }
  </code></pre>
  
  <p>But this code only works the first time I click on "Examine" button, when I click again on it, the restriction dissapears. I've been looking for other events like <code>onclick</code> to write this code in that event, but I don't find the best way to do it, Anyone has any idea?</p>
  
  <p>Greetings.</p>