Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Maintain : Backgroundcolor gridcells

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Maintain : Backgroundcolor gridcells
 Login/Join
 
Platinum Member
posted
Hi,

I have an application that when it opens a grid is populated , what i need to do now , is dynamically change the color of a cell depending on the value of that cell

Any clues on how i can do this?

Peter


D: WF 7.6.2 P. : WF 7.6.2 on W2003
------------------------------------------------------------------
I see myself as an intelligent, sensitive human, with the soul of a clown which forces me to blow it at the most important moments.

-Jim Morrison-

 
Posts: 206 | Registered: February 25, 2005Report This Post
Master
posted Hide Post
Hey Pete
I believe this code is what you need. In this demo, if the value in the cell is 0 then change the color of the cell.

Only thing is, when the form refreshes, the colors change. You SHOULD put this code in an ONLOAD function and that should be good.

Mark


var numberOfRows = eval("window.Grid1_nor"); // evaluate entire Grid
var count = 0; // set count to zero
for (count = 0; count < numberOfRows; count++)
// for count equals 0, count less than number of Grid rows, increment count
{
val = parseInt( window.Grid1_grid[col][count] ); // evaluate integer value in column 0, row
if ( !isNaN( val ) )
{
if (val == 0) // if value equals zero
{
Form1.Grid1.QuickSetBackColor (col, count, 0xFF); // Set background color to RED
// ----- OR -----
Form1.Grid1.QuickSetTextColor (col, count, 0xFF); // Set foreground color to RED
}
Form1.Grid1.RedrawAll();
} }
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Platinum Member
posted Hide Post
Hi Mark,

I been playing with your solution a bit , but how can i put this in an onload function

is this in an HTML control?

can you please give me an example?

Thanks

P.


D: WF 7.6.2 P. : WF 7.6.2 on W2003
------------------------------------------------------------------
I see myself as an intelligent, sensitive human, with the soul of a clown which forces me to blow it at the most important moments.

-Jim Morrison-

 
Posts: 206 | Registered: February 25, 2005Report This Post
Master
posted Hide Post
Hey Pete
An Onload function is a Javascript file that you create separately and link or embed into the application. Here is the code:

var OriginalOnload = document.body.onload;
document.body.onload = LoadFunct;

function LoadFunct() {
if (OriginalOnload) OriginalOnload ();

// your code goes here

}

Once this code is embedded (or linked) to the form, every time the form refreshes, the code runs. You will need this to dynamically change the cell colors. I have a good article on OnLoad functions. Send me your e-mail and I will get it to you.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Platinum Member
posted Hide Post
Hi Mark

I played a bit with the method you gave me , and i got it working now !!!!

Thanks (again)

P.


D: WF 7.6.2 P. : WF 7.6.2 on W2003
------------------------------------------------------------------
I see myself as an intelligent, sensitive human, with the soul of a clown which forces me to blow it at the most important moments.

-Jim Morrison-

 
Posts: 206 | Registered: February 25, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Maintain : Backgroundcolor gridcells

Copyright © 1996-2020 Information Builders