-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-107.html
217 lines (204 loc) · 8.06 KB
/
template-107.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<h1 id="ef-checkbox-formatter">EF Checkbox Formatter</h1>
<p>This formatter creates a <a href="https://ui.refinitiv.com/elements/checkbox">ef-checkbox</a> which will be unchecked by default.</p>
<h2 id="example">Example</h2>
<code-sandbox hash="f57416c3"><pre><code class="language-css">efx-grid {
height: 320px;
}
</code></pre>
<pre><code class="language-html"><efx-grid id="grid"></efx-grid>
</code></pre>
<pre><code class="language-javascript">import { halo } from './theme-loader.js'; // This line is only required for demo purpose. It is not relevant for your application.
await halo(); // This line is only required for demo purpose. It is not relevant for your application.
/* ---------------------------------- Note ----------------------------------
DataGenerator, Formatters and extensions are exposed to global scope
in the bundle file to make it easier to create live examples.
Importing formatters and extensions is still required in your application.
Please see the document for further information.
---------------------------------------------------------------------------*/
var fields = ["industry"];
var records = DataGenerator.generateRecords(fields, { seed: 1, numRows: 25 });
records[1]["myCheckBoxState"] = true; // Initialize checkbox state
records[2]["myCheckBoxState"] = true;
records[3]["myCheckBoxState"] = true;
var configObj = {
columns: [
{
alignment: "c",
name: "",
field: "myCheckBoxState",
width: 34,
binding: EFCheckboxFormatter.create({
events: {
"click": function(e) {
console.log("clicked");
}
}
})
},
{
name: "Grid Checkbox State",
field: "myCheckBoxState",
alignment: "c",
width: 150
},
{
name: "Industry",
field: fields[0],
}
],
staticDataRows: records
};
var grid = document.getElementById("grid");
grid.config = configObj;
</code></pre>
</code-sandbox><h3 id="checkbox-with-a-label">Checkbox with a label</h3>
<code-sandbox hash="1812a6e9"><pre><code class="language-css">efx-grid {
height: 320px;
}
</code></pre>
<pre><code class="language-html"><efx-grid id="grid"></efx-grid>
</code></pre>
<pre><code class="language-javascript">import { halo } from './theme-loader.js'; // This line is only required for demo purpose. It is not relevant for your application.
await halo(); // This line is only required for demo purpose. It is not relevant for your application.
/* ---------------------------------- Note ----------------------------------
DataGenerator, Formatters and extensions are exposed to global scope
in the bundle file to make it easier to create live examples.
Importing formatters and extensions is still required in your application.
Please see the document for further information.
---------------------------------------------------------------------------*/
var fields = ["companyName", "industry"];
var records = DataGenerator.generateRecords(fields, { seed: 1, numRows: 25 });
var configObj = {
columns: [
{
name: "Checkboxes",
field: "myCheckBoxState",
width: 150,
binding: EFCheckboxFormatter.create({
events: {
"click": function(e) {
console.log("clicked");
}
},
labelField: fields[0]
})
},
{
name: "Grid Checkbox State",
field: "myCheckBoxState",
alignment: "c",
width: 150
},
{
name: "Industry",
field: fields[1]
}
],
staticDataRows: records
};
var grid = document.getElementById("grid");
grid.config = configObj;
</code></pre>
</code-sandbox><h3 id="checkbox-and-pagination">Checkbox and pagination</h3>
<code-sandbox hash="3567a345"><pre><code class="language-css">hr {
margin: 5px;
}
</code></pre>
<pre><code class="language-html"><efx-grid id="grid"></efx-grid>
<hr>
<ef-pagination id="pagination_elem"></ef-pagination>
</code></pre>
<pre><code class="language-javascript">import { halo } from './theme-loader.js'; // This line is only required for demo purpose. It is not relevant for your application.
await halo(); // This line is only required for demo purpose. It is not relevant for your application.
/* ---------------------------------- Note ----------------------------------
DataGenerator, Formatters and extensions are exposed to global scope
in the bundle file to make it easier to create live examples.
Importing formatters and extensions is still required in your application.
Please see the document for further information.
---------------------------------------------------------------------------*/
var fields = ["companyName", "market", "industry"];
var records = DataGenerator.generateRecords(fields, { seed: 1, numRows: 40 });
var configObj = {
columns: [
{
name: "",
field: "myCheckBoxState",
width: 34,
binding: EFCheckboxFormatter.create()
},
{
name: "Company",
field: fields[0]
},
{
name: "Market",
field: fields[1]
},
{
name: "Industry",
field: fields[2]
}
],
staticDataRows: records,
pagination: {
element: document.getElementById("pagination_elem"),
page: 1,
pageSize: 8
},
extensions: [new Pagination()]
};
var grid = document.getElementById("grid");
grid.config = configObj;
</code></pre>
</code-sandbox><h3 id="multiple-checkbox-columns">Multiple checkbox columns</h3>
<code-sandbox hash="a4c2f118"><pre><code class="language-css">efx-grid {
height: 320px;
}
</code></pre>
<pre><code class="language-html"><efx-grid id="grid"></efx-grid>
</code></pre>
<pre><code class="language-javascript">import { halo } from './theme-loader.js'; // This line is only required for demo purpose. It is not relevant for your application.
await halo(); // This line is only required for demo purpose. It is not relevant for your application.
/* ---------------------------------- Note ----------------------------------
DataGenerator, Formatters and extensions are exposed to global scope
in the bundle file to make it easier to create live examples.
Importing formatters and extensions is still required in your application.
Please see the document for further information.
---------------------------------------------------------------------------*/
var fields = ["companyName", "market"];
var records = DataGenerator.generateRecords(fields, { seed: 1, numRows: 40 });
var configObj = {
columns: [
{
name: "Company",
field: fields[0]
},
{
name: "Market",
field: fields[1]
},
{
name: "C1",
field: "checkState1",
width: 50,
binding: EFCheckboxFormatter.create()
},
{
name: "C2",
field: "checkState2",
width: 50,
binding: EFCheckboxFormatter.create()
},
{
name: "C3",
field: "checkState3",
width: 50,
binding: EFCheckboxFormatter.create()
}
],
staticDataRows: records
};
var grid = document.getElementById("grid");
grid.config = configObj;
</code></pre>
</code-sandbox>