在flas中使用webix

2024-09-28 22:15:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试理解webix框架,并将其与我的flask应用程序一起使用。所有文档都处理html文件或php示例中的静态数据。在

填充datatable的简单html文件如下所示(根据 文件

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <link rel="stylesheet" href="../static/css/webix.css" type="text/css" charset="utf-8">
    <script src="../static/js/webix.js" type="text/javascript" charset="utf-8"></script>
    <title>Webix Test 4</title>
</head>
<body>
    <script>
      webix.ui({
          id:"dtable",
          view:"datatable",
          url:"/gettabledata"
      });
    </script>
</body>
</html>

在我的烧瓶路由器中,我完成了以下工作(来自教程):-

^{pr2}$

网页没有显示任何内容。在

我有一个类似的问题,试图理解如何使用python和flask加载变量(比如页面标题)。在

显然,在webix如何使用python/flask的过程中,我缺少一些基本的东西。 (嵌入数据的页面工作正常,没有问题)


Tags: 文件textflasktitlehtmltypejsscript
1条回答
网友
1楼 · 发布于 2024-09-28 22:15:05

首先你要试一下,不要用烧瓶

index.html

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <link rel="stylesheet" href="http://cdn.webix.com/edge/webix.css" type="text/css" charset="utf-8">
    <script src="http://cdn.webix.com/edge/webix.js" type="text/javascript" charset="utf-8"></script>
    <title>Webix Test 4</title>
</head>
<body>
    <script>
webix.ui({
    rows: [{
        view: "template",
        type: "header",
        template: "My App!"
        }, {
            view: "datatable",
            autoConfig: true,
            editable: true,
            data: [
        {'title': "01. Basique", 'duration': "3:38"},
        {'title': "02. Moon", 'duration': "3:47"},
        {'title': "03. Unsaid", 'duration': "3:48"},
        {'title': "04. Eitheror", 'duration': "5:45"},
        {'title': "05. Above the Clouds", 'duration': "3:50"}]
        }]
    });
    </script>
</body>
</html>

python3 -m http.server 9004

jsfiddle

那就用烧瓶试试吧

^{pr2}$

相关问题 更多 >