how to insert TODO elements to column and row #479
Replies: 4 comments 4 replies
-
now i can . but for how to add delete button beside todo . is there a way? my code from nicegui import ui
# alldata = ['dqw','ddwqdwq']
alldata = ui.column()
name = ui.input(label="insert name")
def addnow():
alldata.default_slot.children.append(ui.label(name.value))
print(alldata)
ui.update()
def inc():
counter.text +=1
print(counter.text)
with ui.column():
name
ui.button("tatatat", on_click=addnow),
alldata
ui.run() |
Beta Was this translation helpful? Give feedback.
-
and how to update the data from nicegui import ui
# alldata = ['dqw','ddwqdwq']
alldata = ui.column()
name = ui.input(label="insert name")
tasks = ui.column()
def lihat(row):
print(row.id)
tasks[row.id].update(ui.label("udate now"))
def addnow():
with tasks:
with ui.row() as row:
ui.label(name.value)
ui.button("update",on_click=lambda :lihat(row))
with ui.column():
name
ui.button("add", on_click=addnow),
alldata
ui.run() |
Beta Was this translation helpful? Give feedback.
-
and when I want to access any of the indexes inside row . why can not . and how? code def lihat(row):
print(row[0])
def addnow():
with tasks:
with ui.row() as row:
ui.label(name.value)
ui.button("update",on_click=lambda :lihat(row)) TypeError: 'Row' object is not subscriptable |
Beta Was this translation helpful? Give feedback.
-
As @falkoschindler wrote in #489 it is currently not possible to access the elements individually in a row. Best practice is to store the elements in a separate list to access them later. |
Beta Was this translation helpful? Give feedback.
-
i want to make crud todo with this framework . how to insert element to column and can . using for inside with ui.column()
example code:
Beta Was this translation helpful? Give feedback.
All reactions