• Data view "row" link

    By Dejan Ljubič 1 decade ago

     

    Hi,
    
    I am looking how to create a &quot;row&quot; link in view and/or dataview that opens the document in edit mode. I would like that the whole &lt;tr&gt; tag to be the link, so wherever I click it opens the document. I found a way that works if I use the repeat component with an onclick javascript function that opens the document. It is possibel to do the same with the view and the data view component?<br/>
    &nbsp;</div>
    
    Regards
    
    &nbsp;
    
    • By Alex Bartels 1 decade ago

      Hi Dejan,



      I have done the same with the JQuery library:

      1. Download and add the jquery.min.js to your application
      2. add this file as a resource to your XPage or integrate it in your theme
      3. specify 1 column of your data view as 'display as link'
      4. create a Javascript library and paste the following function:

        function linkRow(){

        $('tr').dblclick(function() {
        var href = $(this).find(&quot;a&quot;).attr(&quot;href&quot;);<br/>
        if(href) {<br/>
            window.open(href, &quot;_blank&quot;);<br/>
        }<br/>
        
        });

        }

        linkRow();
      5. Add it to your XPage
      6. hope it works



        Kind regards,

        Alex
      • Doesn't work for me

        By Dejan Ljubič 1 decade ago

        I tried like you told, but it didn't work. 

        Thanks anyway.