Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Customized dmc-datatable #482

Open
bdbais opened this issue Jun 8, 2020 · 0 comments
Open

Customized dmc-datatable #482

bdbais opened this issue Jun 8, 2020 · 0 comments

Comments

@bdbais
Copy link

bdbais commented Jun 8, 2020

Good morning,
I need to customize some columns on a dmc-datatable, is it possible?
I tried on "normal way", catched columns name and change result, but after 1 sec the dmc-datatable engine modified everything, is it possibile to have an example like this?

`




{% if view.list_actions %}

                        {% endif %}
                        {% for header, header_title in headers %}
                            <th data-name="{{ header }}" class="{{ header }} sorting" tabindex="0" aria-controls="table" rowspan="1" colspan="1" style="width: 103px;">{{ header_title|title }}</th>
                        {% endfor %}
                    </tr>
                </thead>
                <tbody>
                    <tr style="display:none"><td></td></tr> {# fix for invalid colpan on datatable init #}
                    {% for item, row in data %}
                        <tr>
                            {% for column_name, item in row.items %}
                                {% if column_name == 'filename1' or column_name == 'filename2' %}
                                        <td><a href='/media/coverage/out/{{ row.codice }}/{{ item|filename}}'>{{ item|filename }}</a></td>
                                {% else %}
                                    {% if column_name == 'ods_file' or column_name == 'bed_file' %}
                                        {% if item == '' %}
                                            <td></td>
                                        {% else %}
                                            <td><a href='/media/coverage/{{ column_name|extfilename}}/{{ item|filename}}'>{{ item|filename }}</a></td>
                                        {% endif %}
                                    {% else %}
                                        {% if column_name in view.list_display %}
                                            <td>{{ item }}</td>
                                        {% endif %}
                                    {% endif %}
                                {% endif %}
                            {% endfor %}
                        </tr>
                    {% endfor %}
                </tbody>
            </table>

`

If I comment dmc-datatable show items in right way but I lose everything, like pagination and sorting and actions.






Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants