Results 1 to 2 of 2

Thread: How to show alert message if pdf file not found in server?

  1. #1
    Sencha User
    Join Date
    May 2012
    Vote Rating

    Default How to show alert message if pdf file not found in server?

    i have done application using Extjs, here requirement is need to download file from server also need to showcase loadmask untill file is completely download. Here i am generating dynamic pdf url by appending name to server base URL. some time in server don't have pdf file for particular url(name) may be they will add or delete the pdf files for some names, but i am assigning generated pdf url based on selected name to ifrmae as a source path. if the pdf is not found in server that time iframe is shows a page, like 404 server not found etc... instead of this one i need to showcase alert message pdf file is not available for this particular name. Can anybody tell me How to achieve this one? great appreciated. Thank you.

    Here is my code:

    getPdfDataIniFrame: function(vesselName){
                var strVesselName=vesselName;
                vesselSpecificationName=strVesselName.replace(" ","_");
        Ext.getCmp('pnlPdf').update('<iframe id="iframeId" width="100%" height="85%" frameborder="0" scrolling="no" src="'+speficationUrl+'"></iframe>')

  2. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Boise, ID
    Vote Rating


    If you request the PDF using an Ext.Ajax.request() you can pass a callback to the request. The callback gets three params passed to it - the second being whether the response passed back to the request was true or false. So, in your response you pass back success: false in your JSON response and if false show an alert or Ext.Msg.alert() with your alerting message.

Tags for this Thread

Posting Permissions

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