Backgrid.js
Backgrid.js is a set of components for building semantic and easily stylable
data grid widgets. It offers a simple, intuitive programming interface that
makes easy things easy, but hard things possible when dealing with tabular data.
Features
The goal of Backgrid.js is to produce a set of core Backbone UI elements that
offer you all the basic displaying, sorting and editing functionalities you'd
expect, and to create an elegant API that makes extending Backgrid.js with extra
functionalities easy.
Advantages
- No Hungarian notations.
- Solid foundation. Based on Backbone.js.
- Semantic and easily stylable. Just style with plain CSS like you would a normal HTML table.
- Low learning curve. Works with plain old Backbone models and collections. Easy things are easy, hards things possible.
- Highly modular and customizable. Components are just simple Backbone View classes, customization is easy if you already know Backbone.
- Lightweight. Extra features are separated into extensions, which keeps the bloat away.
- Good documentation.
Supported browsers:
- Internet Explorer 8+ [1]
- Chrome 4+
- Safari 4+
- Firefox 4+
Notes:
[1]: Both the desktop and mobile versions of the above browsers are supported.
Example
var Territory = Backbone.Model.extend({});
var Territories = Backbone.Collection.extend({
model: Territory,
url: "examples/territories.json"
});
var territories = new Territories();
territories.fetch();
var columns = [{
name: "id",
label: "ID",
editable: false,
cell: Backgrid.IntegerCell.extend({
orderSeparator: ''
}1)
}, {
name: "name",
label: "Name",
cell: "string"
}, {
name: "pop",
label: "Population",
cell: "integer"
}, {
name: "percentage",
label: "% of World Population",
cell: "number"
}, {
name: "date",
label: "Date",
cell: "date",
}, {
name: "url",
label: "URL",
cell: "uri"
}];
var grid = new Backgrid.Grid({
columns: columns,
collection: territories,
});
$("#example-1-result").append(grid.render().el);
Result:
Take a look here.
More Examples
Are you kidding me? This is a README file. Go to the documentation to find out more :)
License
Copyright (c) 2013 Jimmy Yuen Ho Wong
Licensed under the MIT license.