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     [CLOSED] Column title wrap in a read/write grid: maintain

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Column title wrap in a read/write grid: maintain
 Login/Join
 
Member
posted
Hi All,

A quick query. is it possible to wrap the column title in a read/write grid ?

Any suggestions much appreciated.

Thank you

Aravindan

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 17 | Registered: October 19, 2010Report This Post
Master
posted Hide Post
I believe this code will allow multi-line headings in a grid:

{
Form1.Grid1.QuickSetCellTypeEx(2, -1, 2);
Form1.Grid1.QuickSetText(2, -1, "M\na\nr\nk\n"); -* replace this last value with field values.
Form1.Grid1.SetColWidth(2, 20);
Form1.Grid1.RedrawCell(2, -1);
}

The -1 in the first row means the heading. The \n is the carriage return.

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

Thanks again for your help. where should i put this piece in a windows onload function. Do you think the windows onload function will be triggered everytime the grid refreshes.

Thank you

Aravindan


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 17 | Registered: October 19, 2010Report This Post
Master
posted Hide Post
Here is some code that another client is using in 7.6.11. Basically you can create your own onload event.

Mark

function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}

addLoadEvent(function() {
var numRows = Form1.Grid1.GetNumberRows();
var count = 0;
for (count = 0; count <= numRows; count++)
{
Form1.Grid1.GetCell(3,count);
var StrCellGet = Form1.Grid1.CellGetText;
if (StrCellGet == 0)
{
Form1.Grid1.GetCell(3, count);
Form1.Grid1.CellSetBackColor(0x0000ff);
Form1.Grid1.CellSetTextColor(0x0000ff);
Form1.Grid1.SetCell(3, count);
Form1.Grid1.RedrawAll();
}
}
})
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Member
posted Hide Post
Hi Mark,

Thanks for your response. A strange thing is happening.

Firstly , Form1.Grid1.GetNumberRows(); is not functioning. It is not getting rowcount. So i am updating the row count in an invisible editbox and getting it from there. The strange thing is the onload function works when i put an alert on the row-count , the row-count pops up and after i close the onload works .

But when i remove the alert and let the window load as usual without any alerts. The window onload does not do its duty.

I am using the following code

 
addLoadEvent(function() 
{
var numRows = document.getElementById("GridCount").value;
var count = 0;
alert(numRows);
for (count = 0; count < numRows; count++) 
{
evest_prod_non_assets.Grid1.GetCell(5,count);
var StrCellGet = evest_prod_non_assets.Grid1.CellGetText;
if ((StrCellGet !== 'Y') && (StrCellGet !== 'y'))
{
evest_prod_non_assets.Grid1.GetCell(11,count);
evest_prod_non_assets.Grid1.CellSetReadOnly(1);
evest_prod_non_assets.Grid1.SetCell(11,count);
evest_prod_non_assets.Grid1.GetCell(12,count);
evest_prod_non_assets.Grid1.CellSetReadOnly(1);
evest_prod_non_assets.Grid1.SetCell(12,count);
evest_prod_non_assets.Grid1.GetCell(13,count);
evest_prod_non_assets.Grid1.CellSetReadOnly(1);
evest_prod_non_assets.Grid1.SetCell(13,count);
evest_prod_non_assets.Grid1.GetCell(14,count);
evest_prod_non_assets.Grid1.CellSetReadOnly(1);
evest_prod_non_assets.Grid1.SetCell(14,count);
evest_prod_non_assets.Grid1.QuickSetBackColor(11,count,0x00C0C0C0);
evest_prod_non_assets.Grid1.QuickSetBackColor(12,count,0x00C0C0C0);
evest_prod_non_assets.Grid1.QuickSetBackColor(13,count,0x00C0C0C0);
evest_prod_non_assets.Grid1.QuickSetBackColor(14,count,0x00C0C0C0);
evest_prod_non_assets.Grid1.RedrawAll();
}
}
}
)
 


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 17 | Registered: October 19, 2010Report This Post
Master
posted Hide Post
This may be due to a timing issue. Basically when the JS performs, the grid may not be fully drawn on the screen. An easy way to test for this is to place the JS code behind a button. When the form displays, click the button and see if it works correctly.

This has been a sporadic issue with the Active X grid.

One thing to try is to call the JS function from mntonload.js. Locate that file in:
ibi\devstudio\ibi_html\javaassist\ini\html\maint

And add the function call. When that file is loaded (automatically) it can kick off your js code.

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

Yes you are correct with the timing issue . Bang on Target. I resolved it using a js timedelay function setTimeout and delayed the function call by one second. The onload function now works fine.

Regards

Aravindan


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 17 | Registered: October 19, 2010Report This Post
Master
posted Hide Post
Could you please post that delay?

I'm sure it will help other customers!

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report 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     [CLOSED] Column title wrap in a read/write grid: maintain

Copyright © 1996-2020 Information Builders