Loading ...
Sorry, an error occurred while loading the content.

17651Re: Links in a DataTable

Expand Messages
  • ter31024
    Sep 4, 2007
      Hello,

      Thanks for the assistance. I've decided that it'd make the most sense
      to simply override the formatLink formatter in this instance.
      Unfortunately, I'm not having much luck doing that either. Here is
      what I have...

      ==========================================

      YAHOO.widget.DataTable.formatLink(el, oRecord, oColumn, oData) {
      el.InnerHTML = '<a href=" + oData + '.html">' + oData + '</a>';
      }

      var myColumnDefs = [{
      key: 'A_HOST_HOSTNAME',
      sortable: true,
      formatter: YAHOO.widget.DataTable.formatLink
      }];

      ==========================================

      So, for example if the A_HOST_HOSTNAME key is "server1" a link will
      automatically be generated as http://server/server1. What I'd like to
      do is change that link to server1.html.

      The above code doesn't do that though, it generates an error:

      'missing ; before statement'
      YAHOO.widget.DataTable.formatLink(el, oRecord, oColumn, oData) {\n

      I just don't get it :-( ... If I remove the override, the error goes
      away. There must be an easier way to simply generate a link in a
      datatable. Any help at all would be greatly appreciated.

      Thanks,
      Tom
    • Show all 11 messages in this topic