-
Notifications
You must be signed in to change notification settings - Fork 9
/
brwselect2.prg
72 lines (46 loc) · 1.81 KB
/
brwselect2.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
// {% LoadHrb( 'lib/tweb/tweb.hrb' ) %}
#include {% TWebInclude() %}
function main()
LOCAL o, oWeb
DEFINE WEB oWeb TITLE 'Browse Select' TABLES INIT
DEFINE FORM o
INIT FORM o
HTML o INLINE '<h3>Test BrwSelect() 2</h3><hr>'
ROWGROUP o
BUTTON LABEL 'Test TWebBrwSelect()' GRID 6 ACTION 'Test()' OF o
ENDROW o
DIV o ID 'log'
ENDDIV o
HTML o
<script>
function Test() {
var headers = { 'id' : 'Id.' , 'name': 'Item Name', 'price': 'Precio' }
var rows = [{ 'id' :1, 'name' : 'Pepi', 'price' : 123 , 'dummy' : 1 } ,
{ 'id' :2 , 'name' : 'Mari', 'price' : 345 , 'dummy' : 2 } ,
{ 'id' :3 , 'name' : 'Runa', 'price' : 757 , 'dummy' : 3 } ,
{ 'id' :4 , 'name' : 'Site', 'price' : 111 , 'dummy' : 4 } ,
{ 'id' :5 , 'name' : 'Boyi', 'price' : 222 , 'dummy' : 5 } ,
{ 'id' :6 , 'name' : 'John', 'price' : 757 , 'dummy' : 6 } ,
{ 'id' :7 , 'name' : 'John', 'price' : 888 , 'dummy' : 7 },
{ 'id' :8 , 'name' : 'John', 'price' : 777 , 'dummy' : 8 },
{ 'id' :9 , 'name' : 'John', 'price' : 666 , 'dummy' : 9 },
{ 'id' :10, 'name' : 'John', 'price' : 555 , 'dummy' : 6 }
]
var oOptions = new Object()
oOptions[ 'search' ] = true
oOptions[ 'height' ] = 400
//oOptions[ 'select' ] = false
$('#log').html('')
TWebBrwSelect( headers, rows, myfunc, '<i class="fas fa-user-friends"></i> My Customers', oOptions )
}
function myfunc( row ) {
if ( row ) {
$('#log').html( '<b>Name: </b>' + row.name + '<br>' +
'<b>Price: </b>' + row.price + '<br>' +
'<b>Dummy: </b>' + row.dummy )
}
}
</script>
ENDTEXT
END FORM o
retu nil