简体   繁体   中英

Custom list template in flask

Is possible to custom list template in flask.
Assume, I want to move show, edit, delete buttons to the right side, but I don't figure out any solution to do it.
Does anyone know how to do it?

在此处输入图像描述

Solution: Make your own widget template
https://flask-appbuilder.readthedocs.io/en/latest/templates.html#example-1-custom-list-widget

{% block begin_loop_values %}
    {% for item in value_columns %}
        {% set pk = pks[loop.index-1] %}
        <tr>
            {% for value in include_columns %}
                <td>{{ item[value] }}</td>
            {% endfor %}
            {% if can_show or can_edit or can_delete %}
                <td><center>
                {{ lib.btn_crud(can_show, can_edit, can_delete, pk, modelview_name, filters) }}
                </center></td>
            {% endif %}
        </tr>
    {% endfor %}
{% endblock %}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM