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

Chage Color of Cell in data table

Expand Messages
  • ntimesc
    Hi, I want to change the color of cell as it s content changes. So please do post the code or some guideline to do the same. Thanking You, ntimesc
    Message 1 of 4 , Dec 24, 2007
    • 0 Attachment
      Hi,

      I want to change the color of cell as it's content changes.

      So please do post the code or some guideline to do the same.


      Thanking You,
      ntimesc
    • Satyam
      In the column definitions you can specify a formatter, like this: {key: fieldName , ..., formatter:function(el, oRecord, oColumn, oData) { if (oData
      Message 2 of 4 , Dec 24, 2007
      • 0 Attachment
        In the column definitions you can specify a formatter, like this:

        {key:'fieldName', ..., formatter:function(el, oRecord, oColumn, oData) {
        if (oData < 'someValue') {
        el.style.color = 'red';
        }
        el.innerHTML = oData;
        }, ...}


        You can set the color based on the cell's value or of any other condition on
        any other field in the record. You can access any of them via

        oRecord.getData('fieldName');

        And, of course, you can set any style property

        Satyam


        ----- Original Message -----
        From: "ntimesc" <ntimesc@...>
        To: <ydn-javascript@yahoogroups.com>
        Sent: Monday, December 24, 2007 3:30 PM
        Subject: [ydn-javascript] Chage Color of Cell in data table


        > Hi,
        >
        > I want to change the color of cell as it's content changes.
        >
        > So please do post the code or some guideline to do the same.
        >
        >
        > Thanking You,
        > ntimesc
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        > --
        > No virus found in this incoming message.
        > Checked by AVG Free Edition.
        > Version: 7.5.516 / Virus Database: 269.17.7/1194 - Release Date:
        > 23/12/2007 17:27
        >
        >
      • nihar bhatt
        what if i want to change the background color of that cell ??
        Message 3 of 4 , Dec 24, 2007
        • 0 Attachment
          what if i want to change the background color of that cell ??

          On Dec 24, 2007 9:02 PM, Satyam <satyam@...> wrote:

          In the column definitions you can specify a formatter, like this:

          {key:'fieldName', ..., formatter:function(el, oRecord, oColumn, oData) {
          if (oData < 'someValue') {
          el.style.color = 'red';
          }
          el.innerHTML = oData;
          }, ...}

          You can set the color based on the cell's value or of any other condition on
          any other field in the record. You can access any of them via

          oRecord.getData('fieldName');

          And, of course, you can set any style property

          Satyam

          ----- Original Message -----
          From: "ntimesc" <ntimesc@...>
          To: <ydn-javascript@yahoogroups.com>
          Sent: Monday, December 24, 2007 3:30 PM
          Subject: [ydn-javascript] Chage Color of Cell in data table

          > Hi,
          >
          > I want to change the color of cell as it's content changes.
          >
          > So please do post the code or some guideline to do the same.
          >
          >
          > Thanking You,
          > ntimesc
          >
          >
          >
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          > --
          > No virus found in this incoming message.
          > Checked by AVG Free Edition.
          > Version: 7.5.516 / Virus Database: 269.17.7/1194 - Release Date:
          > 23/12/2007 17:27
          >
          >


        • Satyam
          All CSS style attributes are just as accessible: http://www.w3schools.com/css/default.asp Satyam ... From: nihar bhatt To: ydn-javascript@yahoogroups.com Sent:
          Message 4 of 4 , Dec 24, 2007
          • 0 Attachment
            All CSS style attributes are just as accessible:
             
             
            Satyam
             
            ----- Original Message -----
            Sent: Monday, December 24, 2007 5:16 PM
            Subject: Re: [ydn-javascript] Chage Color of Cell in data table

            what if i want to change the background color of that cell ??

            On Dec 24, 2007 9:02 PM, Satyam <satyam@...> wrote:

            In the column definitions you can specify a formatter, like this:

            {key:'fieldName', ..., formatter:function(el, oRecord, oColumn, oData) {
            if (oData < 'someValue') {
            el.style.color = 'red';
            }
            el.innerHTML = oData;
            }, ...}

            You can set the color based on the cell's value or of any other condition on
            any other field in the record. You can access any of them via

            oRecord.getData('fieldName');

            And, of course, you can set any style property

            Satyam

            ----- Original Message -----
            From: "ntimesc" <ntimesc@...>
            To: <ydn-javascript@yahoogroups.com>
            Sent: Monday, December 24, 2007 3:30 PM
            Subject: [ydn-javascript] Chage Color of Cell in data table

            > Hi,
            >
            > I want to change the color of cell as it's content changes.
            >
            > So please do post the code or some guideline to do the same.
            >
            >
            > Thanking You,
            > ntimesc
            >
            >
            >
            >
            > Yahoo! Groups Links
            >
            >
            >
            >
            >
            > --
            > No virus found in this incoming message.
            > Checked by AVG Free Edition.
            > Version: 7.5.516 / Virus Database: 269.17.7/1194 - Release Date:
            > 23/12/2007 17:27
            >
            >



            No virus found in this incoming message.
            Checked by AVG Free Edition.
            Version: 7.5.516 / Virus Database: 269.17.7/1194 - Release Date: 23/12/2007 17:27
          Your message has been successfully submitted and would be delivered to recipients shortly.