N
N
NeGaN2020-02-04 15:08:41
Python
NeGaN, 2020-02-04 15:08:41

How to create an editable table on a web page?

I need to organize a web page on which data is loaded from the database into a table and on which I can change them. I write simple python scripts. I was able to organize the output of a data table from the sqlite3 database to a page created using Flask. I do not understand how to organize the addition of new rows to the database by conditionally clicking on the "+" sign in the table.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
V
Vladimir Korotenko, 2020-02-04
@firedragon

pressing + creates an object that you fill with data
send a POST command to the server /api/users
get an id
every time you change to a new column call PATCH /api/users

F
Filart97, 2020-02-04
@Filart97

When you click on the + button, make it so that the form (tag) is rendered with the table fields (this is done using javascript), well, add the form submit button. In short, read about html form.

R
Roman Kitaev, 2020-02-04
@deliro

How can I help you? Take Django and its tutorial and do it. Throw Flask away into a corner until you learn how to program.

A
Anton R., 2020-02-04
@anton_reut

By clicking on + using JS, add tr and td to the page, inside the cells of the field as in the form, then when you click the Save button, the data from this form flies to the database. What's the problem then?

A
Anton Shamanov, 2020-02-04
@SilenceOfWinter

https://www.datatables.net/ I think this is what you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question