Dynamically adding data and statesaving.

Dynamically adding data and statesaving.

jordan123jordan123 Posts: 4Questions: 0Answers: 0
edited November 2011 in General
Hi.

I am using the datatable to make playlists. So users can add songs to it dynamically. What I want to do is have it so when the page is refreshed all the songs that are currently in the playlist are still there,

how would I go about doing this?

Thanks

Replies

  • mikedmiked Posts: 43Questions: 3Answers: 0
    not sure I'm clear on exactly what you are trying to describe, assuming that the song and playlist data is stored in a db

    use ajax to call a server side script that retrieves the playlist with current contents, perform a save after a new row is added to the playlist, when a page refresh occurs you call the original ajax script to reload the datatable.

    hope this helps
  • jordan123jordan123 Posts: 4Questions: 0Answers: 0
    Oh. I guess did not explain it that well. What I have is initially a blank playlist. I have a search form and users can search for songs etc and add them to the playlist. I don't save the specific playlist to the database since its different for each person.

    What I am doing is kind of like this example: http://datatables.net/release-datatables/examples/api/add_row.html

    Notice how after rows are added in the example and the page is refreshed, the rows disappear. Would I be able to have those saved in cache somehow and then re load them on a page refresh?
  • mikedmiked Posts: 43Questions: 3Answers: 0
    edited November 2011
    obviously you'll need to save the data in the playlist somewhere so that the data can be retrieved on refresh, where did you have in mind?

    where do the songs that feed the playlist come from? ie where do you fetch the song data from so that someone can add the songs to a playlist.

    Seems like a pretty simple db operation to load/save, thinking I'm missing something...
This discussion has been closed.