Use of WebGrid: (1) When a single line, the keyword of the line will be used to a text box for other purposes.

xiaoxiao2021-03-06  85

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);

}

}

}

转载请注明原文地址:https://www.9cbs.com/read-106883.html

New Post(0)