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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Maintain js Grid CellSetText error

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] Maintain js Grid CellSetText error
 Login/Join
 
Gold member
posted
Hello,

I am trying to set the value of 2 columns of the current row in a js grid using CellSetText (col, row, value). Below is my js code.

var objDg = document.getElementById('Grid1');//returns null
var objDg2 = document.Form1.Grid1;//returns a dg obj
objDg2.CellSetText (0, 1, 'Y'); //sets the value of the 1st cell in 2nd row correctly
Code Breaks here
objDg2.CellSetText (2, 1, "test");// only gets to this point if the value of col 0 is already "Y"

I have tried:
1) replacing double quotes with single quotes
2) using document.Form1.Grid1 instead of objDg2
3) switching the lines so column 2 is set before column 0
4) using GetCurrentRow and SetCurrentRow

I use this code on other .mnt files and forms without error, I do no understand why this will not work in the .mnt/form.
I am using Maintain version 7.7.03.

Any suggestions will be appreciated.

Thank you,
Deana

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


WebFOCUS 7.6.8 and 7.7.03; Windows Server 2003 R2 and Windows Server 2008 R2, respectively; Development environments - Windows Server 2003 R2 and Windows 7 Professional, respectively;
excel, html, pdf
 
Posts: 89 | Registered: March 19, 2011Report This Post
Master
posted Hide Post
Deana
This code works for me:

Form1.Grid1.CellSetText(0,1,'Y');
Form1.Grid1.CellSetText(2,1,'test');

If this code doesn't work for you, please open a case and we can go from there.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Gold member
posted Hide Post
This issue is user error. I had 2 .js files, 1 for common code used for multiple forms and one for form specific code. A function got deleted from the common code. I don't remember editing the shared .js file, but must have at some point.

Thank you Mark for your assistance.


WebFOCUS 7.6.8 and 7.7.03; Windows Server 2003 R2 and Windows Server 2008 R2, respectively; Development environments - Windows Server 2003 R2 and Windows 7 Professional, respectively;
excel, html, pdf
 
Posts: 89 | Registered: March 19, 2011Report 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     [Solved] Maintain js Grid CellSetText error

Copyright © 1996-2020 Information Builders