Notice: The Monaca & Onsen UI Community Forum is shutting down.

For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.

Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.

Get item click from list with json array



  • How can i get detail from click 1 item at this list ?

    function nowPlaying() {
    var nowPlayUrl = https://api.themoviedb.org/3/movie/now_playing?api_key=API_KEY&language=en-US;
    $.ajax({
    url: nowPlayUrl,
    method: ‘GET’,
    dataType: ‘JSONP’,
    success: function (res) {
    var print = “”;
    var movie = res.results;
    for (var i = 0; i < movie.length; i++) {
    print += <ul class="list" style="padding: 10px; margin-top: 20px;"> <li class="list-item"> <div class="list-item__left"> <img src="https://image.tmdb.org/t/p/w500/${movie[i].poster_path}" style="width: 100%; height: 150px" alt="${movie[i].title}"> </div> <div class="list-item__center"> <div class="list-item__subtitle"><b>${movie[i].title}</b></div> <div class="list-item__subtitle">${movie[i].overview.substring(0, 40)} ...</div> <div class="list-item__subtitle"><b>Release Date :</b> ${movie[i].release_date}</div> <div class="list-item__subtitle"><b>Vote Count :</b> ${movie[i].vote_count}</div> </div> </li> </ul>;
    }
    document.getElementById(‘isiNowPlaying’).innerHTML = print;
    },
    error: function (err) {
    console.log(err);
    }
    });
    }


  • administrators

    Can you please provide more information about what you want to do, further than ‘get detail’?

    From what I can see you’re doing an AJAX call for a list of movies and then displaying the results in lists. I can’t see any Onsen components (except maybe the list-item_ classes?) so I am a bit confused.