Advertisement
Guest User

Untitled

a guest
Jul 31st, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Ext.define('Oficina.view.FileDownload', {
  2.     extend : 'Ext.panel.Panel',
  3.     alias : 'widget.FileDownloader',
  4.     hidden:true,
  5.     autoEl : {
  6.         tag : 'iframe',
  7.         cls : 'x-hidden',
  8.         src : Ext.SSL_SECURE_URL
  9.     },
  10.     stateful : false,
  11.     load : function(config) {
  12.         var e = this.getEl();
  13.         e.dom.src = config.url
  14.                 + (config.params ? '?' + Ext.urlEncode(config.params) : '');
  15.         e.dom.onload = function() {
  16.             if (e.dom.contentDocument.body.childNodes[0].wholeText == '404') {
  17.                 Ext.Msg.show({
  18.                     title : 'Attachment missing',
  19.                     msg : 'The document you are after can not be found on the server.',
  20.                     buttons : Ext.Msg.OK,
  21.                     icon : Ext.MessageBox.ERROR
  22.                 })
  23.             }
  24.         }
  25.     }
  26. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement