Tune getCode () in the OnRowSelect event, that is, when a row is selected, a keyword of the line is assigned to a text box for future use.
Function getCode ()
{
Var Grid = WGGGRIDBYID ("WGPLANXX");
Var Lastobj = grid.getSelectedObject ();
Var row = lastobj.getrowElement ();
FRMPLANXX.TXTKEYCODE.VALUE = WGGETCETCELLBYNAME (Row, "UMRPID"). innerText;
}
The use of the selectrow () method is mainly: When the page is loaded, the first behavior is selected, and it is selected when the first behavior is selected.
Function SECTROW ()
{
IF (Document.all.Item ("WGPLANXX")! = NULL)
{
Var Grid = WGGGRIDBYID ("WGPLANXX");
Var htbl = grid.getroottable (). getTBTBELEMENT ();
IF (htbl.rows.length> 0)
{
Var rows = htbl.rows;
Var destrow;
For (var i = 0; i
IF (wggetcellbyname (rows [i], "umrpid"). InnerText == frmplanxx.txtKeycode.Value)
{
DESTROW = ROWS [I];
Break;
}
IF (Destrow == Null)
Grid.getroottable (). SELECTROW (0);
Else
Grid.getroottable (). SELECTROW (DESTROW.ROWINDEX);
}
}
}