Skip to content

Instantly share code, notes, and snippets.

@stevenpsmith
Created January 23, 2012 17:54
Show Gist options
  • Save stevenpsmith/1664512 to your computer and use it in GitHub Desktop.
Save stevenpsmith/1664512 to your computer and use it in GitHub Desktop.
activities.each(function(activity){
var renderedItem = template(activity.toJSON()),
$renderedItem = $(renderedItem); //convert the html into an jQuery object
$renderedItem.jqmData('activityId', activity.get('id')); //set the data on it for use in the click event
$renderedItem.bind('click', function(){
//set the activity id on the page element for use in the details pagebeforeshow event
$('#activity-details').jqmData('activityId', $(this).jqmData('activityId')); //'this' represents the element being clicked
});
listView.append($renderedItem);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment