Involver Developer Network : ajax_link
This page last changed on Sep 12, 2011 by kristin.bradley@involver.com.
OverviewRenders an anchor tag that, when clicked, loads a partial. ConfigurationRequires a partial to be defined using the partial tag. Caching ConsiderationsAttributes
ExamplesSimple ExampleGenerates a link that will load in the paginated rss_feed: {% partial name:'lazy_partial' %} {% rss_feed %} {% paginate rss_feed.feed_items per_page:5 %} {% for item in feed_items %} {{ item.title }}<br> {% endfor %} {% endpaginate %} {% endrss_feed %} {% endpartial %} <!-- this generates a link that will load the rss feed represented in the above partial --> {% ajax_link partial:'lazy_partial' container:'rss_container'%}load rss feed{% endajax_link %} <div id="rss_container"> <!-- this container will be populated with the rss feed --> </div> Complex ExampleYou can pass in local context variables that will be available to the partial: {% partial name: 'feed_partial' %} {% for item in feed.feed_items %} {{ item.title }}<br> {% endfor %} {% endpartial %} <div class="feed-box top-feed"> {% rss_feed name:'feed1' %} {% ajax_link partial:'feed_partial' container:'rss_container' feed: rss_feed %}load feed1{% endajax_link %} {% endrss_feed %} </div> <div class="feed-box bottom-feed"> {% rss_feed name:'feed2' %} {% ajax_link partial:'feed_partial' container: 'rss_container' feed: rss_feed %}load feed2{% endajax_link %} {% endrss_feed %} </div> <div id="rss_container"></div> FAQThis FAQ has no questions yet. Related Topics |
![]() |
Document generated by Confluence on Feb 12, 2013 09:09 |