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.
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.
var Territory = BackboneModel;var Territories = BackboneCollection;var territories = ;// Fetch some countries from the urlterritories;// Column definitionsvar columns =name: "id" // The key of the model attributelabel: "ID" // The name to display in the headereditable: false // By default every cell in a column is editable, but *ID* shouldn't be// Defines a cell type, and ID is displayed as an integer without the ',' separating 1000s.cell: BackgridIntegerCellname: "name"label: "Name"// The cell type can be a reference of a Backgrid.Cell subclass, any Backgrid.Cell subclass instances like *id* above, or a stringcell: "string" // This is converted to "StringCell" and a corresponding class in the Backgrid package namespace is looked upname: "pop"label: "Population"cell: "integer" // An integer cell is a number cell that displays humanized integersname: "percentage"label: "% of World Population"cell: "number" // A cell type for floating point value, defaults to have a precision 2 decimal numbersname: "date"label: "Date"cell: "date"name: "url"label: "URL"cell: "uri" // Renders the value in an HTML <a> element;// Initialize a new Grid instancevar grid =columns: columnscollection: territories;// Render the grid and attach the Grid's root to your HTML document;
Take a look here.
Are you kidding me? This is a README file. Go to the documentation to find out more :)
Copyright (c) 2013-present Cloudflare, Inc. Licensed under the MIT license.