Run core-ajax and display results in row clicked

42 views
Skip to first unread message

Jeremy Odekirk

unread,
Mar 3, 2015, 9:49:59 AM3/3/15
to polym...@googlegroups.com

I am trying to display a Table of Contents that displays the subsections using ajax when the row is clicked.
How do you run core-ajax and display the response inside the core-collapse? I know how to run the simple core-ajax demo when you have a single ID on the page, but I don't understand how to run core-ajax dynamically for the row it's clicked on when you might have thousands of rows. How do you get the ajax to run and then return the results and display them in the clicked row?

Here's my guess so far.
It currently displays hard coded subsections, but I'd like to run an ajax onClick and display the results in the row instead, but it's not working.
How do you display core-ajax responses without a unique ID to load the response into?

Jeremy Odekirk

unread,
Mar 12, 2015, 3:58:22 PM3/12/15
to polym...@googlegroups.com
After a lot of trial and error I figured out how to click on a button and have it run a core-ajax and display the contents inside the component.
Here's my updated functional code:

Polymer Demo - Get YouTube Artists Top 25 Videos on-Click with core-ajax


It displays static data but then onClick it pulls the Top 25 videos from YouTube and displays the contents next to the static data.
Reply all
Reply to author
Forward
0 new messages