Код: Выделить всё
# dashboard/dash_apps/aggrid.py
from dash import html
import dash_ag_grid as dag
import dash_bootstrap_components as dbc
from django_plotly_dash import DjangoDash
from dashboard.views import get_latest_data
from dashboard.config_views.config import column_settings
external_stylesheets = [dbc.themes.BOOTSTRAP]
app = DjangoDash("AGGrid", external_stylesheets=external_stylesheets)
df = get_latest_data()
column_defs = ..
app.layout = html.Div(
style={"height": "100%", "width": "100%"},
children=[
# Umgebender Div, um die Höhe zu steuern
html.Div(
dag.AgGrid(
id="ag-grid",
columnDefs=column_defs,
rowData=df.to_dict("records"),
defaultColDef={
"filter": True,
"sortable": True,
"resizable": True,
},
dashGridOptions={
"enableBrowserTooltips": True,
"domLayout": "normal",
},
# style={"height": "100%", "width": "100%"},
),
style={"height": "100%", "width": "100%"},
),
],
)
Код: Выделить всё
{% block title %}Meine Django App{% endblock %}
{% load static %}
html, body {
height: 100%;
margin: 0;
}
#app {
height: 100%;
}
main {
height: 100%;
}
....
{% block content %}
{% endblock %}
© 2023 Meine Django App
Код: Выделить всё
{% extends 'dashboard/base.html' %}
{% load plotly_dash %}
{% block title %}
Dash AG Grid View
{% endblock %}
{% block content %}
{% plotly_app name="AGGrid" %}
{% endblock %}
У меня есть база html, который я также показал. Надеюсь, кто-нибудь сможет помочь.
Подробнее здесь: https://stackoverflow.com/questions/792 ... very-small