AnsweredAssumed Answered

Functioning hyperlinks in a DataGrid

Question asked by thek04 on Jul 31, 2013
Latest reply on Jul 31, 2013 by btfou
I have a grid that displays data when a user selects features on a map. Part of the data that displays in the grid is multiple columns that contain urls that will link to documents.

How would I format the cells in the grid with the urls to make them hyperlinks?

function updateGrid(featureSet){   var data=[];   var grid = dijit.byId('grid');   dojo.forEach(featureSet, function (entry) {    data.push({     objectid:entry.attributes.objectid,     apino:entry.attributes.apino,     otherid:entry.attributes.otherid,     operator:entry.attributes.operator,     county:entry.attributes.county,     twp:entry.attributes.twp,     rge:entry.attributes.rge,     headeruri:entry.attributes.headeruri,     section_:entry.attributes.section_,     drillertotaldepth:entry.attributes.drillertotaldepth,     formationtd:entry.attributes.formationtd,     wellname:entry.attributes.wellname        });           });   var dataForGrid= {    items: data    };       var store = new dojo.data.ItemFileReadStore({data:dataForGrid});   grid.setStore(store);  }


The fields that contain the headeruri reference are the ones that I am trying to make into hyperlinks.


[HTML]<table data-dojo-type="dojox.grid.DataGrid" escapeHTMLInData="false" jsid="grid" id="grid" data-dojo-props="rowsPerPage:'5', rowSelector:'20px'" style="height:100%; width:100%">
          <thead>
            <tr>
     <th field="apino" width="auto">API No</th>
     <th field="otherid" width="auto">State Permit No</th>
     <th field="operator" width="auto">Operator</th>
     <th field="county" width="auto">County</th>
     <th field="twp" width="auto">Township</th>
     <th field="rge" width="auto">Range</th>
     <th field="section_" width="auto">Section</th>
     <th field="drillertotaldepth" width="auto">Depth (ft)</th>
     <th field="formationtd" width="auto">Formation at Depth</th>
     <th field="headeruri" width="auto">Well Folder</th>
     <th field="headeruri" width="auto">Scanned Well Log</th>
     <th field="headeruri" width="auto">LAS Data</th>
            </tr>
          </thead>
        </table>[/HTML]

I have been trying to use escapeHTMLInData with little success. I am still new to javascript and html so my knowledge is pretty limited.


Ken

Outcomes