Django + Tastypie + Backbone.js = TastyBackbonePie
jQuery plugin to create ajax data tables using a django-tastypie api backend. Includes a way to easily paginate, sort and filter tables too.
https://github.com/sspross/tastybackbonepie
var book_table_settings = {
uid: 'book_table',
root_url: '/api/v1/book/',
fields: [
{
'key': 'id',
'label': '#',
},
{
'key': 'name',
'label': 'Name',
'order_by': 'name',
},
{
'key': 'added',
'label': 'Added at',
'order_by': 'added',
},
{
'key': 'read',
'label': 'Read',
'template': '<% if (entry.get(\'read\') == true) { %>x<% } %>',
'order_by': 'read',
},
],
additional_html_fields: [
'<a class="btn btn-mini" href="#" data-id="<%= entry.get(\'id\') %>"><i class="icon-trash"></i></a>',
]
};
var book_table = $('#book-table').renderTastyBackbonePieTable(book_table_settings);
Written by Silvan Spross
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#