Skip to content

Customized dmc-datatable #482

@bdbais

Description

@bdbais

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.






Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions