Originally posted by Maintain Wizard:
The New JS Grid has some great features. The techniques that Alan refered to for the HTMLTable can be used in the new grid. First of all you need to build the field in your stack for every row of the grid:
Compute i/i2=1
Repeat stk.foccount
Compute Stk(I).cbox/a100 = "<input type=checkbox name=check" || I | " value=1>";
Compute i=i+1;
endrepeat
Then you need to add that column to the grid. This creates the field check1 ... checkn as unique objects on your form. In order to retrieve the values from the grid you need to use:
Compute I=1;
Repeat stk.foccount
Compute Stk(I).Sel/a3 = Form1.GetHTMLField('check' || I);
Compute I=I+1;
Endrepeat
You can then screen on that field. A value of 1 is checked.
But now you have to tell the grid that that field is HTML and not text. In 7.72 there is a field in the dialogue box that does this for you. In 7.70 / 7.71 you have to do it. In order to make sure the grid looks correct when the form appears create a file called JSGridOnload.js (font matters) and place this command in it:
ColumnSetContentType(col, contentType)
contentType: 0 – Text 1 – HTML 2 - Image
ex. Form1.Grid1.ColumnSetContentType(1,0);
That's it. Create the field with HTML commands in your stack. Place the stack / field in the grid. Tell Maintain that that cell is HTML, and retrieve your values.
Mark