On Friday, August 5, 2016 at 2:26:51 PM UTC-7, Gael Princivalle wrote: > > Hello. > > I would like to update a javascript array by ajax, keeping the data into > the db. > We talk about markers data for Google maps. > > Here is how I load the data when the page is loaded. > var locations = [ > {{for event in events:}} > {title: '{{=event.title}}', > link: '{{=URL('default', 'show_event', vars=dict(id= > event.id))}}', > location: {lat: {{=event.latitude}}, lng: {{=event. > longitude}} }}, > {{pass}} > ]; > > If the user change in a form some criteria like event date or event type, > I would like to update the markers dynamically, without a page reload. > > Can I do it by ajax? > > Thanks. > > Are you trying to update the client, or update the server? In either case, the answer seems to be yes. In addition to the LOAD helper, there's some conversations around here about jquery. I thought I had seen a more direct answer recently, but I can't put my finger on it. But have a look at
<URLhttps://groups.google.com/d/msg/web2py/m0wrV8fK4dE/7Uhw7Vs8AwAJ> Massimo's discussion of Collection+JSON might be helpful, too. <URL:https://groups.google.com/d/msg/web2py/WN9yzLIfi6M/mFEAOySVSH4J> /dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.