Search code examples
extjsextjs3

How to link a pdf download in JsonStore for Extjs 3.4


I would like to have the pdf item (f_release_note) be a link to open the pdf.
f_release_note - is stored in the database as blob.

Medit.Admin.ReleaseNotes.Stores.ReleaseNotes = new Ext.data.JsonStore({
    storeId: 'ReleaseNotes',
    url: 'fc.php?_C_A=ReleaseNotes.getList',
    root: 'root',
    remoteSort: true,
    autoLoad: true,
    successProperty: 'succcess',
    baseParams: {
        start: 0,
        limit: 25
    },
    idProperty: 'f_uid',
    fields: [{
        name: 'f_uid',
        type: 'int'
    
    }, {
        name: 'f_release',
        type: 'date',
        dateFormat: 'm/d/Y'
    
    },{
        name:'f_version_number',
        type: 'string'
    },{
       name:'f_release_note',
       type:'string'
    }]
});

Screen display Release Notes

Release Version Number Release Note 2/09/2021 25.01.01 Release 21.01 pdf

I would like to have the ability for the user to click Release 21.01 pdf and open the pdf file.


Solution

  • Maybe something like this?

    items: [{
      layout: 'fit',
      html: '<iframe src="resources/docs/releaseinfo/' + record.get('filenameOrSomething') + '.pdf" style="width: 100%; height: 100%; border: none;"/>'
    }],
    

    Or just an regular link to a blank window?