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

DataTable Hyperlinks Question

Expand Messages
  • m_giovenco
    Hey all, Here s my question: Within my Datatable, I have a column called Id. What I want to occur is when a paricular ID is selected, the yui will bring it to
    Message 1 of 3 , Feb 29, 2008
    • 0 Attachment
      Hey all,

      Here's my question:

      Within my Datatable, I have a column called Id. What I want to occur
      is when a paricular ID is selected, the yui will bring it to a new page
      (based on what's selected).

      So far, I know how to format the data into a link, but I don't know how
      to specify where it's directed. How is this done?

      Also, is it possible to pass values along the way from that selected
      cells' other columns (besides the id, maybe the name, or the type?).
    • Satyam
      You can, in the columns definition for Id, format the contents of the cell like a link: {key: id , label: ID , formatter:function
      Message 2 of 3 , Feb 29, 2008
      • 0 Attachment
        You can, in the columns definition for Id, format the contents of the cell
        like a link:

        {key:"id", label:"ID", formatter:function (elCell,oRecord,oColumn,oData) {
        elCell.innerHTML = '<a href="something.html?id=' + oData + '">' +
        oData + '</a>';
        }},

        You can also read any other value within the same record, that's why you get
        the oRecord argument, for example:

        {key:"id", label:"ID", formatter:function (elCell,oRecord,oColumn,oData) {
        elCell.innerHTML = '<a href="something.html?id=' + oData + '&type='
        + escapeURIComponent (oRecord.getData('type')) + '">' +
        oRecord.getData(name) + '</a>';
        }},

        When assembling the URL, always remember to URL-escape anything that might
        have characters that would break the URL.

        Satyam

        ----- Original Message -----
        From: "m_giovenco" <Chaos6575@...>
        To: <ydn-javascript@yahoogroups.com>
        Sent: Friday, February 29, 2008 10:30 PM
        Subject: [ydn-javascript] DataTable Hyperlinks Question


        > Hey all,
        >
        > Here's my question:
        >
        > Within my Datatable, I have a column called Id. What I want to occur
        > is when a paricular ID is selected, the yui will bring it to a new page
        > (based on what's selected).
        >
        > So far, I know how to format the data into a link, but I don't know how
        > to specify where it's directed. How is this done?
        >
        > Also, is it possible to pass values along the way from that selected
        > cells' other columns (besides the id, maybe the name, or the type?).
        >
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        > --
        > No virus found in this incoming message.
        > Checked by AVG Free Edition.
        > Version: 7.5.516 / Virus Database: 269.21.1/1303 - Release Date:
        > 28/02/2008 12:14
        >
        >
      • m_giovenco
        Awesome, that s exactly what I needed. Thank you very much for your help!
        Message 3 of 3 , Feb 29, 2008
        • 0 Attachment
          Awesome, that's exactly what I needed. Thank you very much for your
          help!
        Your message has been successfully submitted and would be delivered to recipients shortly.