-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-127.html
42 lines (40 loc) · 2.16 KB
/
template-127.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
<h1 id="row---highlight-and-selection">Row - Highlight and Selection</h1>
<p>Row highlighting can be turned on/off by setting the options for <code>rowHighlighting</code> to <em>true</em> and <em>false</em> respectively. Row highlighting will be turn on by default.</p>
<p>All related row selection functionalities can be added through the <a href="#/extensions/tr-grid-row-selection">Row Selection Extension</a>.</p>
<h2 id="example">Example</h2>
<code-sandbox hash="fd6ae299"><pre><code class="language-css">efx-grid {
height: 200px;
}
html hr {
margin: 5px;
}
</code></pre>
<pre><code class="language-html"><big>Hover mouse over Grid to see row highlighting</big>
<hr>
<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", "CF_LAST", "CF_NETCHNG", "industry"];
var records = DataGenerator.generateRecords(fields, { numRows: 6 });
var configObj = {
rowHighlighting: true, // Add This Property to turn on/off
columns: [
{name: "Company", field: fields[0]},
{name: "Market", field: fields[1], width: 100},
{name: "Last", field: fields[2], width: 80},
{name: "Net. Chng", field: fields[3], width: 80},
{name: "Industry", field: fields[4]}
],
staticDataRows: records
};
var grid = document.getElementById("grid");
grid.config = configObj;
</code></pre>
</code-sandbox>