-
Notifications
You must be signed in to change notification settings - Fork 9
/
browse-onchange.prg
83 lines (54 loc) · 1.67 KB
/
browse-onchange.prg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// {% LoadHrb( 'lib/tweb/tweb.hrb' ) %}
#include {% TWebInclude() %}
function main()
local o, oWeb, oCol, oBrw
local aRows := LoadData()
DEFINE WEB oWeb TITLE 'Test Browse' ICON 'images/favicon.ico' TABLES INIT
DEFINE FORM o
o:lDessign := .f.
HTML o INLINE '<h3>Test Browse - onchange event</h3><hr>'
INIT FORM o
ROW o
COL o GRID 6
DEFINE BROWSE oBrw ID 'ringo' HEIGHT 400 ONCHANGE 'SelData' OF o
ADD oCol TO oBrw ID 'first' HEADER 'First' ALIGN 'right'
ADD oCol TO oBrw ID 'last' HEADER 'Last' SORT
ADD oCol TO oBrw ID 'age' HEADER 'Age' WIDTH 70
ADD oCol TO oBrw ID 'state' HEADER 'Estate'
INIT BROWSE oBrw DATA aRows
ENDCOL o
COL o GRID 6
ROWGROUP o
GET ID 'city' VALUE '' GRID 12 LABEL 'City' OF o
ENDROW o
ROWGROUP o
GET ID 'st' VALUE '' GRID 4 LABEL 'State' OF o
GET ID 'zip' VALUE '' GRID 6 LABEL 'Zip' OF o
ENDROW o
ROWGROUP o
GET ID 'hiredate' VALUE '' GRID 6 LABEL 'Hiredate' OF o
ENDROW o
ROWGROUP o
CHECKBOX ID 'married' LABEL 'Married' GRID 6 OF o
ENDROW o
ROWGROUP o
GET ID 'notes' VALUE '' GRID 12 LABEL 'Notes' OF o
ENDROW o
ENDCOL o
ENDROW o
HTML o
<script>
function SelData( e, row ) {
$('#city').val( row.city )
$('#st').val( row.state )
$('#zip').val( row.zip )
$('#hiredate').val( row.hiredate )
$('#married').prop('checked', row.married );
$('#notes').val( row.notes )
$('#married').prop('checked', row.married );
}
</script>
ENDTEXT
END FORM o
retu nil
{% LoadFile( 'loaddata.prg' ) %}