Giter VIP home page Giter VIP logo

kodatatable's People

Contributors

mikeallisonjs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

kodatatable's Issues

Column Reorder

Really liked your interface. So used your code in a project and implemented a column reordering functionality with the help of an existing column reordering tool. here. thanks

Getting error changing pages

Congrats this work, it's pretty cool.

When implementing this plugin I've came across with an odd behaviour while switching pages - although I was unable to reproduce it on the examples page.
Here's my case (using Chrome Version 43.0.2357.65 m - developer tools on):

  • Initial page rendered 20 items;
  • 1st click on the Next rendered one item;
  • 2nd and following clicks on the Next rendered zero items;
  • Clicking in Last rendered the last 20 items.

Solved it by changing from

 this.currentRows = ko.computed((function(_this) {
        return function() {
          if ((_this.currentPage() + 1) * _this.pageSize() > _this.filteredRows().length) {
            return _this.filteredRows().slice(_this.currentPage() * _this.pageSize());
          } else {
            return _this.filteredRows().slice(_this.currentPage() * _this.pageSize(), 
+((_this.currentPage() + 1 * _this.pageSize()) - 1) + 1 || 9e9);
          }
        };

to

 this.currentRows = ko.computed((function(_this) {
        return function() {
          if ((_this.currentPage() + 1) * _this.pageSize() > _this.filteredRows().length) {
            return _this.filteredRows().slice(_this.currentPage() * _this.pageSize());
          } else {
            return _this.filteredRows().slice(_this.currentPage() * _this.pageSize(),
 +(((_this.currentPage() + 1) * _this.pageSize()) - 1) + 1 || 9e9);
          }
        };

Case it's not clear, wrapped the _this.currentPage() + 1 with an extra () in the else block... You have it in the if statement.
Like I wrote, in your example page it works fine.
I'm using bower in this implementation.
Hope it helps.

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.