Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

knockout-datatable

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

knockout-datatable

Knockout DataTable is a flexible and reusable Knockout.js view model for data tables.

  • 0.7.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Knockout DataTable

Knockout DataTable is a flexible and reusable Knockout.js view model for data tables.

Demo

Check out the demo to get a quick idea of how it works and how to use it.

Installation

To install it in your bower-enabled project, run bower install knockout-datatable.

Or drop the knockout-datatable{.min}.js file in your vendor assets javascript folder and require it in your application.

Usage

Refer to the demo for detailed usage instructions.

API

The following methods are available on the DataTable instance:

  • prevPage() - go to the previous page (if not on page 1)
  • nextPage() - go to next page (if not on last page)
  • toggleSort(field)
    • switches to ascending sort if sorted descending by field
    • switches to descending sort if sorted ascending by field
    • sorts ascending by field if not already sorted by field
  • gotoPage(pageNum) - sets the current page to pageNum
  • pageClass(pageNum) - returns "active" if pageNum is the current page
  • addRecord(new_record) - pushes new_record onto the datatable's rows
  • removeRecord(record) - removes record from the datatable's rows
  • replaceRows(new_rows_array)
    • resets the datatable's rows to new_rows_array
    • sets the current page to 1
  • forceFilter(true|false) - enable / disable forcing filtering of the roles
    • tells DataTable to filter the rows even if the current filter is falsey

Building

To build the Knockout DataTable coffeescript source, do the following in a node.js enabled environment:

npm install -g grunt-cli
npm install
grunt

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Contributors

See Contributors

License

Knockout DataTable is released under the MIT License. Please see the LICENSE file for details.

FAQs

Package last updated on 15 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc