0.3.11
. .o8 oooo
.o8 "888 `888
.o888oo .ooooo. .ooooo. 888oooo. 888 .ooooo.
888 d88' `88b d88' `88b d88' `88b 888 d88' `88b
888 888ooo888 888ooo888 888 888 888 888ooo888
888 . 888 .o 888 .o 888 888 888 888 .o
"888" `Y8bod8P' `Y8bod8P' `Y8bod8P' o888o `Y8bod8P'
A tiny table
Teeble is a set of Backbone views and collection abstractions around backbone.paginator.
You are able to page, sort and filter your data easily by creating views that pass events to backbone.paginator
Download the production version or the development version.
Currently you can choose from server-side processing of the pagination, filtering and sorting (Teeble.ServerCollection
) or client-side (Teeble.ClientCollection
). Extending your Backbone collection from one of these base collections will set it up to use all of the backbone.paginator methods
Teeble's main controller is the TableView
. This view contains all of the major event bindings and is in charge of rendering all of the subviews. You can extend this view to provide additional options, methods, events, etc.
table_class
: optional class on the table elementsubviews
: optional overridespartials
collection
footer
compile
HeaderView
: view that renders the headerFooterView
: view the render the footerRowView
: view that renders each rowPaginationView
: view that renders the pagination controlsEmptyView
: view that is rendered if there is no data in the collectionEach of these views can be extended or overridden completely by passing them using the subviews
parameter to the TableView
or setting them explicitly in your extended TableView
Teeble's table-renderer builds templates from partial definitions and renders the different parts of the view. These partials are defined in the partials
parameter which allows you to define templates (header, cell, footer) for each column of the table. This allows you to update your table templates on the fly to do things like add, remove and rearrange columns. The renderer can also be extended or overwritten in the same way as the subviews
Netflix has shut down their OData API, so our server-side paging example doesn't fully work.
In lieu of a formal style-guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "lib" subdirectory!
pager()
arguments for server-side collections{reset: true}
to Backbone when calling pager()
on server-side collections.Copyright (c) 2014 HubSpot Licensed under the MIT license.