-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmacros.njk
More file actions
31 lines (30 loc) · 1 KB
/
Copy pathmacros.njk
File metadata and controls
31 lines (30 loc) · 1 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
{% macro renderDropdown(val_data, rowIndex, colIndex) %}
<span class="gs-select">
<select class="dropdown gs-dropdown gs-interactive-dropdown"
data-row="{{ rowIndex }}"
data-col="{{ colIndex }}"
tabindex="0">
{% for option in val_data.dropdown_options %}
<option value="{{ option }}" {% if option == val_data.dropdown_selected %}selected{% endif %}>
{{ option }}
</option>
{% endfor %}
</select>
</span>
{% endmacro %}
{% macro renderCell(cell, rowIndex, colIndex) %}
{% if cell.val_data.is_checkbox %}
<span class="gs-checkbox">
<input type="checkbox" class="simple-checkbox gs-interactive-checkbox"
{% if cell.val_data.is_checked %}checked{% endif %}
data-row="{{ rowIndex }}"
data-col="{{ colIndex }}"
tabindex="0"
/>
</span>
{% elif cell.val_data.is_dropdown %}
{{ renderDropdown(cell.val_data, rowIndex, colIndex) }}
{% else %}
{{ cell.value }}
{% endif %}
{% endmacro %}