• Document open in new window

    By Klaus Schmitz 2 decades ago

    Dear Jason,

    first of all I would like to thank you for this great work. Especially for notes developers who are not so familiar with web applications it is a really great help. One question. I would like to open the documents in the views in a new browser window. Could you please advise, where and how I have to implement that. Thanks in advance

    Klaus

    • how to: open doc in a new window

      By jason a thomas 2 decades ago

      Hi Klaus,



      Glad you like the work. The NotesView2 class has a method/event called "openDocument" that gets called when a user clicks on a document in the view. By default, this method does nothing. In the sample code that I have posted with each release, the openDocument method is set in the onload event of the $$ViewTemplateDefault form:



      oView.openDocument = function(viewEntry){

      document.location.href = DB_NAME + "/" + VIEW_NAME + "/" + viewEntry.unid + "?Opendocument";

      }



      You can create any implementation of this method that you like before the oView.render() method is called. To open a document in a new window, use this:



      oView.openDocument = function(viewEntry){

      window.open(DB_NAME + "/" + VIEW_NAME + "/" + viewEntry.unid + "?Opendocument");

      }





      Hope this helps:)

      • By Klaus Schmitz 2 decades ago

        Hi Jason,

        perfect. Thanks a lot for the fast advice.

        Kind regards

        Klaus