-
Notifications
You must be signed in to change notification settings - Fork 3
/
pickerview.html
64 lines (43 loc) · 1.66 KB
/
pickerview.html
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
<html>
<head>
<meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no" />
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body onload="ShowPicker()">
<script type="text/javascript" src="NKit.js"></script>
<script>
NKSetPageOpaque('pickerview.html', 'NO');
var navController = new NKNavigationController();
navController.setTitle("Picker");
navController.setTintColor(0, 0, 0);
// Picker ========================================================
NKRegisterClass("MyPickerController");
function ShowPicker()
{
CallNKitAction("showMyPicker?className=MyPickerController");
}
function SetValueForRowInComponent(componentIndex, rowIndex, value)
{
CallNKitAction("SetValueForRowInComponent?className=MyPickerController&component="+componentIndex+"&rowIndex="+rowIndex+"&value="+value);
}
function fillPicker()
{
SetValueForRowInComponent(0, 0, "Small\n(Not Very Big)");
SetValueForRowInComponent(1, 0, "Stilton\n(Very Smelly)");
SetValueForRowInComponent(0, 1, "Medium\n(Kinda Average Size)");
SetValueForRowInComponent(1, 1, "Brie\n(Soft and Runny)");
SetValueForRowInComponent(0, 2, "Large\n(Very large Indeed");
SetValueForRowInComponent(1, 2, "Feta\n(Greek and Salty)");
}
fillPicker();
// Results =======================================================
function showSelection()
{
var selection = CallNKitAction("getSelectedString?className=MyPickerController&sync=yes");
NKAlert("You Chose:", selection);
}
</script>
<div class="infobox">Make a selection from the picker below and get your results returned via a NKAlert instance</div>
<div class="greybutton" onClick="showSelection()">Show Selection</div>
</body>
</html>