Select value to cookies - problem with LOAD SQLFORM.grid

26 views
Skip to first unread message

Adam Drzewiecki

unread,
May 8, 2016, 9:48:23 AM5/8/16
to web...@googlegroups.com
Hello.

I've got a problem with grid component. I added grid to view with LOAD function because i need to refresh data continuously:

{{extend 'layout.html'}}
{{=LOAD('default', 'grid.load', ajax=True, times="infinity", timeout=10000)}}

and my controler looks like below:

def grid():
    links
= [lambda row: A(row['host_name'], _href='http://' + row['host_name'] + ':' + row['port'])]
    selectable
= [('Do something 1', lambda ids: status(ids)), ('Do something 2', lambda ids: status(ids))]
    clients_grid
= SQLFORM.grid(db.clients, editable=False, details=False, maxtextlength=100, links=links, selectable=selectable)
   
return dict(clients_grid=clients_grid)

That code works ok, but when grid is refreshing, selects disappear.
I think that saving selected value in cookies may do the job, but can anyone give me example how to do that ?

Greetings
Adam
Reply all
Reply to author
Forward
0 new messages