• Q about document opening

    By Kerry R Kilpatrick 2 decades ago

    Thanks for the teriffic product. It is really good.



    I am no javascript guru and have a question for you….



    In some views I have documents that contain a Document Title and an attachment, normally PDF. What I would like is for the user to double click on the view entry to open the pdf directly in a new window. I would prefer to do this rather than opening the document and then having the user click on the attachment link. Is this doable?



    I see your comments about opening in a new window, and that part works fine, I just cannot figure out how to open teh attachment directly.



    I would also like the functionality that in other views that the document itself opens. I am thinking this could be controlled by the view you are in.



    I look forward to your comments.



    Thanks again,



    Kerry

    • opening attachments

      By jason a thomas 2 decades ago

      well, is the name of the PDF in any of the view columns? if so, the following code would work:



      oView.openDocument = function(viewEntry){

      var attachmentNameColumn = "0";//set to the column number with the attachment name



      window.open(DB_NAME + "/" + VIEW_NAME + "/" + viewEntry.unid + "/$File/" + viewEntry.columnValues[attachmentNameColumn]);



      }



      If not, then maybe you could add javascript or a meta tag to the form itself that opens the attachment as soon as the form is opened?

      • Works a trest. Thanks Jason<eom>

        By Kerry R Kilpatrick 2 decades ago
      • Works a trest. Thanks Jason<eom>

        By Kerry R Kilpatrick 2 decades ago