Hi is their a way of returning an onclick funtion to a div.

This is what I'm trying to return.

onclick="jQuery('#id').val('{{=row.id}}');ajax('{{=URL('default', 
'album')}}', ['id'], 'playlist');"row.album.

I can get it to return but only as text, I need it to work as a function

This is what I have at the moment.
Controller
links = []
    
    rows = sel.select(db.media.album,db.media.id, groupby= 
db.media.album,orderby=db.media.album)
    #links = map(lambda row:A(row.album, 
callback=URL('tracks',vars=dict(id=row.id)), target='playlist'), rows)
    for row in rows:
        f = 
"onclick=\"jQuery('#id').val('{{=row.id}}');ajax('{{=URL('default', 
'album')}}', ['id'], 'playlist');\"row.albums"
        links.append(f)


test = HTML(UL([LI(link) for link in links]).xml())

return test
Like I said this just returns it as text in the div.

Thanks

-- 
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.

Reply via email to