-
Notifications
You must be signed in to change notification settings - Fork 9
/
browse-edit-v.prg
70 lines (45 loc) · 1.78 KB
/
browse-edit-v.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
// {% LoadHrb( 'lib/tweb/tweb.hrb' ) %}
#include {% TWebInclude() %}
function main()
local o, oCol, oBrw
local aRows := {}
local hCars := {=>}
Aadd( aRows, { 'id' => 'A1', 'name' => 'Charly Aubia' , 'car' => 'V' })
Aadd( aRows, { 'id' => 'A2', 'name' => 'Maria de la O', 'car' => 'R' })
Aadd( aRows, { 'id' => 'A3', 'name' => 'John Kocinsky', 'car' => 'F' })
Aadd( aRows, { 'id' => 'A4', 'name' => 'Anne Clark' , 'car' => '' })
Aadd( aRows, { 'id' => 'A5', 'name' => 'Daniel Clark' , 'car' => 'V' })
Aadd( aRows, { 'id' => 'A6', 'name' => 'Rod Steward' , 'car' => 'F' })
Aadd( aRows, { 'id' => 'A7', 'name' => 'Ally McPerson', 'car' => 'F' })
Aadd( aRows, { 'id' => 'A8', 'name' => 'Bruce Polest' , 'car' => 'R' })
hCars[ '' ] := ''
hCars[ 'V' ] := 'Volvo'
hCars[ 'R' ] := 'Renault'
hCars[ 'F' ] := 'Ferrari'
hCars[ 'S' ] := 'Seat'
hCars[ 'T' ] := 'Toyota'
hCars[ 'C' ] := 'Citroen'
DEFINE WEB oWeb TITLE 'Browse - Edit' TABLES INIT
DEFINE FORM o
HTML o INLINE '<h3>Basic Browse - Clause Edit V </h3><hr>'
INIT FORM o
DIV o ID 'bar' CLASS 'btn-group'
BUTTON LABEL ' Edit' ICON '<i class="far fa-edit"></i>' ACTION 'Edit()' CLASS 'btn-secondary mybtnbar' GRID 0 OF o
ENDDIV o
DEFINE BROWSE oBrw ID 'ringo' MULTISELECT CLICKSELECT HEIGHT 400 ;
EDIT UNIQUEID 'id' ;
TOOLBAR "bar" ;
OF o
oBrw:cLocale := 'es-ES'
ADD oCol TO oBrw ID 'id' HEADER 'Id.' ALIGN 'center'
ADD oCol TO oBrw ID 'name' HEADER 'Name' EDIT TYPE 'V' // Only data view
ADD oCol TO oBrw ID 'car' HEADER 'Car' EDIT TYPE 'COMBOBOX' WITH hCars
INIT BROWSE oBrw DATA aRows
HTML o
<script>
var oBrw = new TWebBrowse( 'ringo' )
function Edit() { oBrw.Edit() }
</script>
ENDTEXT
END FORM o
retu nil