Giter VIP home page Giter VIP logo

backbone.tableview's Introduction

Backbone.TableView

Backbone View to render collections as tables. Currently it is targeted at bootstrap users, in the future it will be more css agnostic.

How To Use

Subclass TableView and add column definitions. Optionaly you can add a title, a search bar, pagination, and any number of filters (see supported filters below):

class UserTableView extends Backbone.TableView
    title: "My Users Table"
    columns:
        name:
            header: "My Name"
        type:
            header: "Type"
        last_login:
            header: "Last Login Time"
            draw: (model) ->
                new Date(model.get "time")
    pagination: true
    search:
        query: "name"
        detail: "Search by Name"
    filters:
        from:
            type: "input"
            className: "date"
            init: new Date()
            get: (val) ->
                ... process the date val ...
        my_button:
            type: "button"
        status:
            type: "option"
            options: ["all", "valid", "invalid"]

Use it as any other Backbone View, either setting the "el" property at creation, or letting backbone create if for you, eg (Users is a regular backbone collection):

user_table = new UserTableView collection: new Users()
$("#somewhere").html user_table.render().el

License

Apache Public License (APL) 2.0

Author

Juan Pablo Bottaro - https://github.com/jpbottaro

Demo

http://jsfiddle.net/jpbottaro/u7zQT/

Thanks

This was initialy inspired by the project https://github.com/jsvine/Backbone.Table

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.