-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1c_PythonExampleGui.html
More file actions
69 lines (59 loc) · 2.28 KB
/
1c_PythonExampleGui.html
File metadata and controls
69 lines (59 loc) · 2.28 KB
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
<!DOCTYPE html>
<html style="padding:20px">
<head>
<meta charset="utf-8">
<title>1a_PythonExample</title>
<script type="text/javascript">
document.write('<link rel="import" href="' + window.Alteryx.LibDir + '2/lib/includes.html">');
</script>
</head>
<body>
<form>
<fieldset>
<legend>XMSG("1_PythonExample")</legend>
<div>
<h2>XMSG("Number of Rows")</h2>
<ayx data-ui-props='{type:"TextBox", widgetId:"NumberRows"}'></ayx>
<h2>XMSG("Number of columns")</h2>
<label>(Min: 1, Max: 20, Step: 1)</label>
<ayx data-ui-props="{type:'NumericSpinner', widgetId:'NumberColumns'}" data-item-props = "{dataName: 'NColumns'}"></ayx>
<h2>XMSG("Free text to fill the cells with")</h2>
<ayx data-ui-props='{type:"TextBox", widgetId:"FreeText"}'></ayx>
</div>
</fieldset>
</form>
<style>
/*This styling needs to be here. Is due to file loading. Otherwise, will not get proper styling on dropdowns*/
.Select, .Select div, .Select input, .Select span {
box-sizing: content-box;
-webkit-box-sizing: content-box;
}
</style>
<script type="text/javascript">
Alteryx.Gui.BeforeLoad = function (manager, AlteryxDataItems, json) {
// TextBox
// -------
// Create string data item
var textBoxDataItem = new AlteryxDataItems.SimpleString('NRows')
manager.addDataItem(textBoxDataItem)
// Bind to TextBox widget
manager.bindDataItemToWidget(textBoxDataItem, 'NumberRows')
// Create string data item
var textBoxDataItem = new AlteryxDataItems.SimpleString('FText')
manager.addDataItem(textBoxDataItem)
// Bind to TextBox widget
manager.bindDataItemToWidget(textBoxDataItem, 'FreeText')
// NumericSpinner
// Create constrained Int item
const constrainedNumberDataItem = new AlteryxDataItems.ConstrainedInt('NColumns', {
max: 20,
min: 1,
step: 1
})
manager.addDataItem(constrainedNumberDataItem)
// Bind to NumericSpinner widget
manager.bindDataItemToWidget(constrainedNumberDataItem, 'NumberColumns')
}
</script>
</body>
</html>