Skip to content

how to use V-bind or :rows for q-table #313

Answered by elimintz
YohannesGetu asked this question in Q&A
Discussion options

You must be logged in to vote

Here is an example of a QTable that updates every 3 seconds:

import justpy as jp
import asyncio

columns = [{'field': 'first', 'label': 'First Col'}, {'field': 'second', 'label': 'Second Col'}, {'field': 'third', 'label': 'Third Col'}, ]
data = [{'first': 1, 'second': 2, 'third': 3}]

wp = jp.QuasarPage(delete_flag=False)
d = jp.Div(classes='q-pa-md', a=wp, style='height: 800px')
table = jp.QTable(title='Update Example', data=data, columns=columns, a=d, dense=True, pagination={'rowsPerPage': 10})
counter = 1

async def table_counter():
    global counter
    while True:
        print(counter)
        counter += 1
        table.data[0]['first'] = counter
        table.data.append({'first': 1*

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@YohannesGetu
Comment options

Answer selected by YohannesGetu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants