Questions tagged [flask-table]

14 questions
5
votes
0 answers

How to set reverse argument in sort_url in Flask table through Python without JS or HTML modifications of table?

Given the following table class ProductsTable(Table): allow_sort=True id=Col('ID', show=False) price=Col('Price') available_online=Col('Available online?') available_num=Col('In stock') edit=ButtonCol('Edit', url_kwargs=dict(id='id'),…
rbaleksandar
  • 8,713
  • 7
  • 76
  • 161
4
votes
1 answer

Formatting flask-table output with html on python

Not a very experienced user with python here, just picked up python while staying at home. I was looking into integrating the output of flask-table to a website. The following is my python code that creates a simple table for my website. from…
Rascal
  • 43
  • 1
  • 5
0
votes
0 answers

Using flask_table to make a checkbox input column

The DonationTable class I am using to show data. In the derived DonationRegisterTable class I want to have a checkbox instead of a BoolCol so user can edit the table. Is there a way to have a checkbox as a column using flask_table? from flask_table…
0
votes
0 answers

Handling WTF form With for Loop correctly

Hello all I am new to flask I am just creating a basic table with DB data as S.no & Name & filling this with some random data of 10 users , Now I am query Db & displaying this list on HTML page in a table , on the HTML page I have added an extra…
0
votes
0 answers

Show row number (i.e., leave Index unsorted) in Flask Table

I currently am using the following code to present a sortable table using Flask. However, I would prefer that the index (i.e., first column) is not a sortable column (i.e., it always shows 1-30 regardless of what other column is sorted). In…
Michael M
  • 57
  • 8
0
votes
1 answer

how to automatically add rows in flask html table

I'd like to automatically add a row for everytime a new "to-do" item is added. Here's how it currently looks like, Here's how I want it to look like - under the "CARD_1" I have an idea of where I am going wrong with this, from my code we can see…
0
votes
1 answer

How to insert javascript to change cell CSS class in a Flask WTF jinja2 table data cell based on the cell value?

I am using Flask WTF to display the results of a database query, but I would like to change the color of the cell background to light red if the value is less than 25. I am not certain how and where to insert the javascript to test the cell value…
0
votes
1 answer

How use Flask LinkCol on database query data results?

I have been working with Flask for a little while and developed a database manager application for managing internal data for the department I work in (I am not a "real" developer but have learned by doing/necessity). The application works great as…
0
votes
1 answer

Generalizing the columns of a Flask Table

I define a specific Flask Table as follows class MyTable(Table): def __init__(self, table_id, rows): self.table_id = table_id super().__init__(rows) Code = Col('Code', column_html_attrs = {'class':…
user11323942
0
votes
1 answer

How do I make buttons with identical text in flask table?

I have the following table set up using flask-table class ScreeningTable(Table): timedate = DatetimeCol('Date & Time', datetime_format='YYYY-MM-d, HH:MM') tickets = Col('Tickets available') I want to add a ButtonCol using a screeningID…
Tasos500
  • 107
  • 2
  • 11
0
votes
1 answer

Is it possible to display images or render html in a flask-table?

I have a flask app using flask-sqlalchemy and flask-table. My table displays just fine but how can I include images in one of the columns? I have tried modifying what gets sent to the table class to be html with an image tag but the result isn't…
Imp0ster
  • 1
  • 2
0
votes
0 answers

Is there a way to set table attributes by cell in python flask?

I'm trying to dynamically create html tables using python flask. I know in the flask documentation (https://flask-table.readthedocs.io/en/stable/), it says you can pass attributes to the td and th html elements, but this only allows you to pass…
Kevin
  • 1
  • 1
0
votes
1 answer

Flask table and LinkCol, ButtonCol - passing value as URL parameter instead of path to endpoint possible?

I have a function defined as follows: @app.route('/products', methods=['GET']) @app.route('/products/', methods=['GET', 'PUT']) def foo(): id = request.args.get('id', type=int) if id != None and request.method in ['GET', 'PUT']: # route…
rbaleksandar
  • 8,713
  • 7
  • 76
  • 161
-1
votes
1 answer

Using Flask-Table how do I change the tables design?

I'm using Flask-Table and I don't know how to change the html design of the table. Does anybody know how I do so?
Roii Zmora
  • 39
  • 6