-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate-109.html
68 lines (65 loc) · 2.59 KB
/
template-109.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
<h1 id="ef-datetime-picker-formatter">EF DateTime Picker Formatter</h1>
<p>This formatter creates <a href="https://ui.refinitiv.com/elements/datetime-picker">ef-datetime-picker</a> without margin. </p>
<h2 id="example">Example</h2>
<code-sandbox hash="d3e74484"><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 = ["date"];
var records = DataGenerator.generateRecords(fields, { seed: 1, numRows: 20 });
var configObj = {
columns: [
{
name: "Data",
field: fields[0],
sortBy: fields[0],
alignment: "c",
binding: function(e) {
var value = e["data"];
var cell = e["cell"];
cell.setContent(value.toDateString());
}
},
{
name: "Simplest",
field: fields[0],
sortBy: fields[0],
alignment: "c",
binding: EFDateTimePickerFormatter.create()
},
{
name: "Some options",
field: fields[0],
sortBy: fields[0],
alignment: "c",
binding: EFDateTimePickerFormatter.create({
attributes: {
format: "yyyy-MM-dd"
},
styles: {
width: "120px"
},
events: {
"value-changed": function(e) {
// console.log("value changed: " + e.detail.value);
}
}
})
}
],
staticDataRows: records
};
var grid = document.getElementById("grid");
grid.config = configObj;
</code></pre>
</code-sandbox>