python - "No matching records found" when using bootstrap-table in Flask -


i'm developing website based on flask, , want load data.json using bootstrap-table. got table without data.

the directory structure displays below:

index.py templates/     new.html     data.json     data1.json static/     css/         bootstrap-table.css         bootstrap-theme.css              bootstrap-theme.min.css          bootstrap.css.map         base.css                        bootstrap-table.min.css          bootstrap-theme.css.map          bootstrap.css                   bootstrap.min.css     js/         bootstrap-table.js              bootstrap.js                    bower_components/              jquery.min.js         bootstrap-table.min.js          bootstrap.min.js                index.js                        npm.js 

and index.py looks this:

62 @app.route("/") 63 def new(): 64     return render_template('new.html') 

the 'new .html' looks this:

<!doctype html> {% extends 'base.html' %} {% block title %}config{% endblock %} {% block head %} {{ super() }} <!--<script type="text/javascript" src='../static/js/index.js'></script> --> {% endblock %} {% block header %}     <p class="title">test</p> {% endblock %} {% block content %} <table data-toggle="table" data-url="data1.json" data-cache="false" data-height="299"> <thead>     <tr>         <th data-field="id">item id</th>         <th data-field="name">item name</th>         <th data-field="price">item price</th>     </tr> </thead> </table> {% endblock %} 

and i've link css , js files needed in base.html

but when index.py running, got page below. displays table, without data

enter image description here

does have met problem?

firstly, in terms of flask, make sure json file located in static folder. it's trivial have tried many times figure out.

then, make sure format of json file contains json array correct.

fyr bootstrap table showing json data


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -