Cool Garry
Could you attach a screenshot?
On Friday, March 27, 2015 at 2:12:29 PM UTC-5, Garry Smith wrote:
>
> Hi
> At last I have got the divs working as I wnated.
>
> The idea was to have 6 columns on a web page, 3 on the top row and three
> on the bottom.
>
> The top row add divs with artist albums and tracks as headings.
> The Bottom with divs with playlist, media abd player.
> The idea was to have Artist load in the artist column when the page opens.
> You would click on the artist, this would the bring their albums from the
> database and put them in the artist column.
> You would then click on the album, this would bring back all the tracks in
> the album and put them into the tracks column.
> Then you click the track, which would be added to the playllst.
>
> To get thisto work, I had to find a way off loading the divs with jquery
> and ajax using Load.
>
> This is the Jquery part:
>
> <span onclick="jQuery('#id').val('{{=row.id}}');ajax('{{=URL
> <http://127.0.0.1:8000/examples/global/vars/URL>('default', 'album')}}',
> ['id'], '');">{{=row.artist}}</span>
>
> This would send the ID of the artist to find all the albums belonging to
> the artist, then put in a table on the database, which then gets pulled
> back in another function and loaded in a temp_album.load which then gets
> loaded into the div with the following code:
>
> {{=LOAD('default','temp_album.load',ajax=True,times='infinity',
> timeout=1000)}}
>
> This then puts it back on the page in the correct div. The times='infinity,
> is what keeps the page loading the data.
> Every time you click a different artist, the table contents in the
> database is deleted and the new albums are inserted bringing back again.
>
> I have done this with all the divs.
>
> The next part is to get a media player to load the playlist and play the
> files.
>
>
> I would like to thank Anthony, Dave S and LoveWeb2py for pointing me in
> the right direction of using LOAD.
>
>
>
>
>
> On Saturday, 21 March 2015 18:19:02 UTC, Garry Smith wrote:
>>
>> Hi
>> I'm trying to return the some links to a div. I have made links with some
>> information from the database and using the A htlm helper.
>> The problem I am having is getting the data back correctly, I am getting
>> the links back correctly, but I am being sent a full web page with the
>> links, which is then put in the div.
>>
>> *VIEW*
>> this is link which is sent to the artist page, which gets all the
>> distinct artist.
>>
>> {{=A('click' , callback=URL('artist'), target="artist")}}
>>
>> *CONTROLLER*
>>
>> This is the controller that makes the links and returns to the div as
>> specified in above link.
>>
>> def artist():
>> rows = db().select(db.media.artist,db.media.id, groupby =
>> db.media.artist)
>>
>> links = []
>>
>> for row in rows:
>> a = str(row.id)
>> b = 'album?id='
>> c = b+a
>> l = row.artist
>> f = A(l , callback=URL(c), target="album")
>> links.append(f)
>>
>> return dict(links=links)
>>
>> I have tried diffrent ways to solve this, but to no avail, all I want is
>> to return the links to div.
>>
>> What i am trying to do is rewrite a media player, which I wrote in php a
>> few years ago, but I am having few issues writing a returning links on the
>> sly.
>>
>> Thanks in advance for any help.
>>
>>
>>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.