django-material icon indicating copy to clipboard operation
django-material copied to clipboard

Customized dmc-datatable

Open bdbais opened this issue 5 years ago • 0 comments

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.

bdbais avatar Jun 08 '20 09:06 bdbais