From 3867c8abbb8b1358a724435ebe5454d40f49d15e Mon Sep 17 00:00:00 2001 From: Ohad Schneider Date: Fri, 13 Mar 2015 17:29:27 +0200 Subject: [PATCH 1/8] Added pagination limit --- demo.html | 420 +++++++++++++++++----------------- example/view.jade | 4 +- knockout-datatable.coffee | 140 ++++++++---- knockout-datatable.js | 142 ++++++++---- knockout-datatable.min.js | 4 +- knockout-datatable.min.js.map | 9 +- 6 files changed, 414 insertions(+), 305 deletions(-) diff --git a/demo.html b/demo.html index 5296d87..0543d1e 100644 --- a/demo.html +++ b/demo.html @@ -44,6 +44,11 @@ border-top: 1px solid #e5e5e5; } + ul.pagination li a { + width: 40px; + text-align: center; + } + /* Customize container */ @media (min-width: 768px) { .container { @@ -131,6 +136,7 @@ sortDir: 'desc', sortField: 'population', perPage: 15, + paginationLimit: 8, unsortedClass: "glyphicon glyphicon-sort", ascSortClass: "glyphicon glyphicon-sort-by-attributes", descSortClass: "glyphicon glyphicon-sort-by-attributes-alt" @@ -154,7 +160,8 @@ tableOptions = { recordWord: 'city', recordWordPlural: 'cities', - perPage: 15 + perPage: 15, + paginationLimit: 7 }; rows = citiesList.map(function(row) { return new City(_this, row); @@ -168,52 +175,46 @@ })(); - +
-
- -

Knockout DataTable

-
-
-

Knockout DataTable Demo

-
-
-
- -

Simple example

-

S'pose we wanted to display a table of cities. Just create a view model for the data:

+
+ +

Knockout DataTable

+
+
+

Knockout DataTable Demo

+
+
+
+ +

Simple example

+

S'pose we wanted to display a table of cities. Just create a view model for the data:

 class City
-
   constructor: (@view, row) ->
     @population  = ko.observable row.population
     @countryName = row.country_name
     @cityName    = row.city_name
-
 class @CitiesModel
-
   constructor: ->
-
     tableOptions =
       recordWord:       'city'
       recordWordPlural: 'cities'
       sortDir:          'desc'
       sortField:        'population'
       perPage:          15
+      paginationLimit:  8
       unsortedClass:    'glyphicon glyphicon-sort'
       ascSortClass:     'glyphicon glyphicon-sort-by-attributes'
       descSortClass:    'glyphicon glyphicon-sort-by-attributes-alt'
-
     @table = new DataTable [], tableOptions
     @table.loading true
-
     req = new XMLHttpRequest()
     req.open 'GET', '/api/cities', true
-
     req.onload = =>
       if req.status >= 200 and req.status < 400
         response = JSON.parse req.responseText
@@ -223,22 +224,19 @@ 

Simple example

else alert "Error communicating with server" @table.loading false - req.onerror = => alert "Error communicating with server" @table.loading false - req.send() - ko.applyBindings @
-

And a table, like so:

+

And a table, like so:

 <div data-bind="with: table">
   <div class="pull-right">
     <strong>Results per page</strong>
-    <select data-bind="options: [10,25,50], value: perPage"></select>
+    <select data-bind="options: [10,25,50,5,1], value: perPage"></select>
   </div>
   <input type="text" data-bind="textInput: filter" placeholder="Search"/>
   <table class="table table-striped table-bordered">
@@ -280,14 +278,14 @@ 

Simple example

</tbody> </table> <span data-bind="text: recordsText" class="label label-info pull-right"></span> - <div data-bind="visible: pages() > 1"> + <div data-bind="visible: limitedPages().length > 1"> <ul class="pagination"> <li data-bind="css: leftPagerClass, click: prevPage"> <a href="#">&laquo;</a> </li> - <!-- ko foreach: {data: (new Array(pages()))} --> - <li data-bind="css: $parent.pageClass($index() + 1)"> - <a href="#" data-bind="text: $index() + 1, click: $parent.gotoPage($index() + 1)"></a> + <!-- ko foreach: {data: limitedPages} --> + <li data-bind="css: $parent.pageClass(number)"> + <a href="#" data-bind="text: number, click: $parent.gotoPage(number)"></a> </li> <!-- /ko --> <li data-bind="css: rightPagerClass, click: nextPage"> @@ -302,186 +300,188 @@

Simple example

}); </script>
-

Result:

-
-
- Results per page - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- City - - - Country - - - Population - -
- This table has no data. -
- - Loading data... -
- -
-
    -
  • - « -
  • - -
  • - -
  • - -
  • - » -
  • -
-
-
- - - -

Example without sorting

-
-
- Results per page - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- City - - Country - - Population -
- This table has no data. -
- - Loading data... -
- -
-
    -
  • - « -
  • - -
  • - -
  • - -
  • - » -
  • -
-
-
- - - -

Options

-

When instanciating with new DataTable you have can pass in the following options as the second parameter:

-
-
recordWord
-
The name of your rows. In the case above, we used city. Default: record
- -
recordWordPlural
-
The plural name of your rows. Since we used city as our recordWord, we used cities for recordWordPlural. Default: recordWord + 's'
- -
sortDir
-
The initial sorting direction for the table. Default: 'asc'
- -
sortField
-
The initial sorting column for the table. As of v0.5.0, this setting is optional and the order of table.rows will be maintained and sorting will be disabled.
- -
perPage
-
Integer indicating the number of rows to be shown per page. Default: 15
- -
unsortedClass
descSortClass
ascSortClass
-
The classes given to the icons in the th elements indicating the direction of sorting. Set to '' if you would rather have no icons. Default: '' for each
-
-

Additionally, you can define the match function on the row class, and the datatable will use it for filtering. If left undefined (as in the example above), the DataTable will automatically search all columns defined on the row. E.g:

-
-
row.match:
-
+                

Result:

+
+
+ Results per page + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ City + + + Country + + + Population + +
+ This table has no data. +
+ + Loading data... +
+ +
+
    +
  • + « +
  • + +
  • + +
  • + +
  • + » +
  • +
+
+
+ + + +

Example without sorting

+
+
+ Results per page + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ City + + Country + + Population +
+ This table has no data. +
+ + Loading data... +
+ +
+
    +
  • + « +
  • + +
  • + +
  • + +
  • + » +
  • +
+
+
+ + + +

Options

+

When instantiating with new DataTable you have can pass in the following options as the second parameter:

+
+
recordWord
+
The name of your rows. In the case above, we used city. Default: record
+ +
recordWordPlural
+
The plural name of your rows. Since we used city as our recordWord, we used cities for recordWordPlural. Default: recordWord + 's'
+ +
sortDir
+
The initial sorting direction for the table. Default: 'asc'
+ +
sortField
+
The initial sorting column for the table. As of v0.5.0, this setting is optional and the order of table.rows will be maintained and sorting will be disabled.
+ +
perPage
+
Integer indicating the number of rows to be shown per page. Default: 15
+ +
unsortedClass
descSortClass
ascSortClass
+
The classes given to the icons in the th elements indicating the direction of sorting. Set to '' if you would rather have no icons. Default: '' for each
+
+

Additionally, you can define the match function on the row class, and the datatable will use it for filtering. If left undefined (as in the example above), the DataTable will automatically search all columns defined on the row. E.g:

+
+
row.match:
+
+
 (filter) ->
   @population().toLowerCase().indexOf(filter) >= 0 or
   @countryName .toLowerCase().indexOf(filter) >= 0 or
-  @cityName    .toLowerCase().indexOf(filter) >= 0
-
- -

Further Usage

-

Knockout DataTable comes packaged with some advanced filtering. Below is a list of example search terms and the results returned.

-
-
cityName:atlanta
-
Results with 'atlanta' in cityName (case insensitive)
-
cItYnAmE:aTlAnTa
-
Results with 'atlanta' in cityName (case insensitive)
-
countryName:United cityName:L
-
Results with 'united' in countryName and 'l' in cityName (case insensitive)

Note: as of right now, there is no built-in support for multi-word searching with ':'-delimeted searching

-
countryname:japan 6
-
Results with 'japan' in countryName and '6' somewhere in one of the columns (case insensitive)
-
+ @cityName .toLowerCase().indexOf(filter) >= 0
+
+
+ +

Further Usage

+

Knockout DataTable comes packaged with some advanced filtering. Below is a list of example search terms and the results returned.

+
+
cityName:atlanta
+
Results with 'atlanta' in cityName (case insensitive)
+
cItYnAmE:aTlAnTa
+
Results with 'atlanta' in cityName (case insensitive)
+
countryName:United cityName:L
+
Results with 'united' in countryName and 'l' in cityName (case insensitive)

Note: as of right now, there is no built-in support for multi-word searching with ':'-delimeted searching

+
countryname:japan 6
+
Results with 'japan' in countryName and '6' somewhere in one of the columns (case insensitive)
+
+
-
- + diff --git a/example/view.jade b/example/view.jade index f4ce31c..25fd7f5 100644 --- a/example/view.jade +++ b/example/view.jade @@ -30,10 +30,10 @@ div.cloak(data-bind='with: exampleTable') span.label.label-info.pull-right(data-bind='text: recordsText') - .pagination(data-bind='visible: pages() > 1') + .pagination(data-bind='visible: pages().length > 1') ul li(data-bind='css: leftPagerClass, click: prevPage'): a(href='#') « - li(data-bind='repeat: {count: pages, bind: "css: pageClass($index + 1)"}') + li(data-bind='repeat: {count: pages().length, bind: "css: pageClass($index + 1)"}') a(href='#', data-bind='text: $index + 1, click: gotoPage($index + 1)') li(data-bind='css: rightPagerClass, click: nextPage'): a(href='#') » diff --git a/knockout-datatable.coffee b/knockout-datatable.coffee index b168ef6..cf4326b 100644 --- a/knockout-datatable.coffee +++ b/knockout-datatable.coffee @@ -24,15 +24,16 @@ class @DataTable # set some default options if none were passed in @options = - recordWord: options.recordWord or 'record' + recordWord: options.recordWord or 'record' recordWordPlural: options.recordWordPlural - sortDir: options.sortDir or 'asc' - sortField: options.sortField or undefined - perPage: options.perPage or 15 - filterFn: options.filterFn or undefined - unsortedClass: options.unsortedClass or '' - descSortClass: options.descSortClass or '' - ascSortClass: options.ascSortClass or '' + sortDir: options.sortDir or 'asc' + sortField: options.sortField or undefined + perPage: options.perPage or 15 + paginationLimit: options.paginationLimit or 10 + filterFn: options.filterFn or undefined + unsortedClass: options.unsortedClass or '' + descSortClass: options.descSortClass or '' + ascSortClass: options.ascSortClass or '' @initObservables() @@ -52,16 +53,46 @@ class @DataTable @sortDir = ko.observable @options.sortDir @sortField = ko.observable @options.sortField @perPage = ko.observable @options.perPage - @currentPage = ko.observable 1 + @currentPageNumber = ko.observable 1 @filter = ko.observable '' @loading = ko.observable false @rows = ko.observableArray [] + + getPages: (rows, perPage) -> + rowIndex = 0 + pageNumber = 1 + pagesArr = new Array(Math.ceil rows / perPage) + while rowIndex < rows + pagesArr[pageNumber - 1] = + number: pageNumber + start: rowIndex + end: Math.min rows-1, rowIndex+perPage-1 + pageNumber++ + rowIndex += perPage + pagesArr + + getLimitedPages: (pages, current, limit) -> + if (pages.length <= limit) + return pages + + leftMargin = Math.floor(limit/2); + firstPage = current - Math.floor(leftMargin) + if (firstPage < 1) + return pages.slice(0, limit) + + rightMargin = if limit%2 == 0 then leftMargin-1 else leftMargin + lastPage = current + rightMargin + if (lastPage > pages.length) + return pages.slice(pages.length - limit, pages.length) + + return pages.slice(firstPage-1, lastPage) + initWithClientSidePagination: (rows) -> @filtering = ko.observable false - @filter.subscribe => @currentPage 1 - @perPage.subscribe => @currentPage 1 + @filter.subscribe => @currentPageNumber 1 + @perPage.subscribe => @currentPageNumber 1 @rows rows @@ -103,35 +134,39 @@ class @DataTable rows .extend {rateLimit: 50, method: 'notifyWhenChangesStop'} - + + @pages = pureComputed => + @getPages @filteredRows().length, @perPage() + + @limitedPages = pureComputed => + @getLimitedPages @pages(), @currentPageNumber(), @options.paginationLimit + + @currentPage = pureComputed => + @pages()[@currentPageNumber() - 1] + @pagedRows = pureComputed => - pageIndex = @currentPage() - 1 - perPage = @perPage() - @filteredRows().slice pageIndex * perPage, (pageIndex+1) * perPage - - @pages = pureComputed => Math.ceil @filteredRows().length / @perPage() + @filteredRows().slice @currentPage().start, @currentPage().end + 1 - @leftPagerClass = pureComputed => 'disabled' if @currentPage() is 1 - @rightPagerClass = pureComputed => 'disabled' if @currentPage() is @pages() + @leftPagerClass = pureComputed => 'disabled' if @currentPageNumber() is 1 + @rightPagerClass = pureComputed => 'disabled' if @currentPageNumber() is @pages().length # info @total = pureComputed => @filteredRows().length - @from = pureComputed => (@currentPage() - 1) * @perPage() + 1 + @from = pureComputed => (@currentPageNumber() - 1) * @perPage() + 1 @to = pureComputed => - to = @currentPage() * @perPage() + to = @currentPageNumber() * @perPage() if to > @total() @total() else to @recordsText = pureComputed => - pages = @pages() - total = @total() from = @from() to = @to() + total = @total() recordWord = @options.recordWord recordWordPlural = @options.recordWordPlural or recordWord + 's' - if pages > 1 + if @pages().length > 1 "#{from} to #{to} of #{total} #{recordWordPlural}" else "#{total} #{if total > 1 or total is 0 then recordWordPlural else recordWord}" @@ -161,7 +196,7 @@ class @DataTable @replaceRows = (rows) => @rows rows - @currentPage 1 + @currentPageNumber 1 @filter undefined _defaultMatch = (filter, row, attrMap) -> @@ -199,20 +234,20 @@ class @DataTable req.open 'GET', url, true req.setRequestHeader 'Content-Type', 'application/json' - req.onload = => + req.onload = -> if req.status >= 200 and req.status < 400 cb null, JSON.parse(req.responseText) else cb new Error("Error communicating with server") - req.onerror = => cb new Error "Error communicating with server" + req.onerror = -> cb new Error "Error communicating with server" req.send() - _gatherData = (perPage, currentPage, filter, sortDir, sortField) -> + _gatherData = (perPage, currentPageNumber, filter, sortDir, sortField) -> data = perPage: perPage - page: currentPage + page: currentPageNumber if filter? and filter isnt '' data.filter = filter @@ -227,14 +262,14 @@ class @DataTable @pagedRows = ko.observableArray [] @numFilteredRows = ko.observable 0 - @filter.subscribe => @currentPage 1 - @perPage.subscribe => @currentPage 1 + @filter.subscribe => @currentPageNumber 1 + @perPage.subscribe => @currentPageNumber 1 ko.computed => @loading true @filtering true - data = _gatherData @perPage(), @currentPage(), @filter(), @sortDir(), @sortField() + data = _gatherData @perPage(), @currentPageNumber(), @filter(), @sortDir(), @sortField() _getDataFromServer data, (err, response) => @loading false @@ -247,28 +282,37 @@ class @DataTable .extend {rateLimit: 500, method: 'notifyWhenChangesStop'} - @pages = pureComputed => Math.ceil @numFilteredRows() / @perPage() + @pages = pureComputed => + @getPages @numFilteredRows().length, @perPage() + + @limitedPages = pureComputed => + @getLimitedPages @pages(), @currentPageNumber(), @options.paginationLimit + + @currentPage = pureComputed => + @pages()[@currentPageNumber() - 1] + + @pagedRows = pureComputed => + @filteredRows().slice @currentPage().start, @currentPage().end + 1 - @leftPagerClass = pureComputed => 'disabled' if @currentPage() is 1 - @rightPagerClass = pureComputed => 'disabled' if @currentPage() is @pages() + @leftPagerClass = pureComputed => 'disabled' if @currentPageNumber() is 1 + @rightPagerClass = pureComputed => 'disabled' if @currentPageNumber() is @pages().length # info - @from = pureComputed => (@currentPage() - 1) * @perPage() + 1 + @from = pureComputed => (@currentPageNumber() - 1) * @perPage() + 1 @to = pureComputed => - to = @currentPage() * @perPage() + to = @currentPageNumber() * @perPage() if to > (total = @numFilteredRows()) total else to @recordsText = pureComputed => - pages = @pages() total = @numFilteredRows() from = @from() to = @to() recordWord = @options.recordWord recordWordPlural = @options.recordWordPlural or recordWord + 's' - if pages > 1 + if @pages().length > 1 "#{from} to #{to} of #{total} #{recordWordPlural}" else "#{total} #{if total > 1 or total is 0 then recordWordPlural else recordWord}" @@ -302,7 +346,7 @@ class @DataTable @loading true @filtering true - data = _gatherData @perPage(), @currentPage(), @filter(), @sortDir(), @sortField() + data = _gatherData @perPage(), @currentPageNumber(), @filter(), @sortDir(), @sortField() _getDataFromServer data, (err, response) => @loading false @@ -314,7 +358,7 @@ class @DataTable @pagedRows results.map(@options.resultHandlerFn) toggleSort: (field) -> => - @currentPage 1 + @currentPageNumber 1 if @sortField() is field @sortDir if @sortDir() is 'asc' then 'desc' else 'asc' else @@ -322,15 +366,15 @@ class @DataTable @sortField field prevPage: -> - page = @currentPage() + page = @currentPageNumber() if page isnt 1 - @currentPage page - 1 + @currentPageNumber page - 1 nextPage: -> - page = @currentPage() - if page isnt @pages() - @currentPage page + 1 + page = @currentPageNumber() + if page isnt @pages().length + @currentPageNumber page + 1 - gotoPage: (page) -> => @currentPage page + gotoPage: (page) -> => @currentPageNumber page - pageClass: (page) -> pureComputed => 'active' if @currentPage() is page + pageClass: (page) -> pureComputed => 'active' if @currentPageNumber() is page diff --git a/knockout-datatable.js b/knockout-datatable.js index 4dc8969..c267dbd 100644 --- a/knockout-datatable.js +++ b/knockout-datatable.js @@ -1,4 +1,4 @@ -(function() { +(function() { var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; this.DataTable = (function() { @@ -36,6 +36,7 @@ sortDir: options.sortDir || 'asc', sortField: options.sortField || void 0, perPage: options.perPage || 15, + paginationLimit: options.paginationLimit || 10, filterFn: options.filterFn || void 0, unsortedClass: options.unsortedClass || '', descSortClass: options.descSortClass || '', @@ -58,23 +59,58 @@ this.sortDir = ko.observable(this.options.sortDir); this.sortField = ko.observable(this.options.sortField); this.perPage = ko.observable(this.options.perPage); - this.currentPage = ko.observable(1); + this.currentPageNumber = ko.observable(1); this.filter = ko.observable(''); this.loading = ko.observable(false); return this.rows = ko.observableArray([]); }; + DataTable.prototype.getPages = function(rows, perPage) { + var pageNumber, pagesArr, rowIndex; + rowIndex = 0; + pageNumber = 1; + pagesArr = new Array(Math.ceil(rows / perPage)); + while (rowIndex < rows) { + pagesArr[pageNumber - 1] = { + number: pageNumber, + start: rowIndex, + end: Math.min(rows - 1, rowIndex + perPage - 1) + }; + pageNumber++; + rowIndex += perPage; + } + return pagesArr; + }; + + DataTable.prototype.getLimitedPages = function(pages, current, limit) { + var firstPage, lastPage, leftMargin, rightMargin; + if (pages.length <= limit) { + return pages; + } + leftMargin = Math.floor(limit / 2); + firstPage = current - Math.floor(leftMargin); + if (firstPage < 1) { + return pages.slice(0, limit); + } + rightMargin = limit % 2 === 0 ? leftMargin - 1 : leftMargin; + lastPage = current + rightMargin; + if (lastPage > pages.length) { + return pages.slice(pages.length - limit, pages.length); + } + return pages.slice(firstPage - 1, lastPage); + }; + DataTable.prototype.initWithClientSidePagination = function(rows) { var _defaultMatch; this.filtering = ko.observable(false); this.filter.subscribe((function(_this) { return function() { - return _this.currentPage(1); + return _this.currentPageNumber(1); }; })(this)); this.perPage.subscribe((function(_this) { return function() { - return _this.currentPage(1); + return _this.currentPageNumber(1); }; })(this)); this.rows(rows); @@ -147,29 +183,36 @@ rateLimit: 50, method: 'notifyWhenChangesStop' }); - this.pagedRows = pureComputed((function(_this) { + this.pages = pureComputed((function(_this) { return function() { - var pageIndex, perPage; - pageIndex = _this.currentPage() - 1; - perPage = _this.perPage(); - return _this.filteredRows().slice(pageIndex * perPage, (pageIndex + 1) * perPage); + return _this.getPages(_this.filteredRows().length, _this.perPage()); }; })(this)); - this.pages = pureComputed((function(_this) { + this.limitedPages = pureComputed((function(_this) { + return function() { + return _this.getLimitedPages(_this.pages(), _this.currentPageNumber(), _this.options.paginationLimit); + }; + })(this)); + this.currentPage = pureComputed((function(_this) { return function() { - return Math.ceil(_this.filteredRows().length / _this.perPage()); + return _this.pages()[_this.currentPageNumber() - 1]; + }; + })(this)); + this.pagedRows = pureComputed((function(_this) { + return function() { + return _this.filteredRows().slice(_this.currentPage().start, _this.currentPage().end + 1); }; })(this)); this.leftPagerClass = pureComputed((function(_this) { return function() { - if (_this.currentPage() === 1) { + if (_this.currentPageNumber() === 1) { return 'disabled'; } }; })(this)); this.rightPagerClass = pureComputed((function(_this) { return function() { - if (_this.currentPage() === _this.pages()) { + if (_this.currentPageNumber() === _this.pages().length) { return 'disabled'; } }; @@ -181,13 +224,13 @@ })(this)); this.from = pureComputed((function(_this) { return function() { - return (_this.currentPage() - 1) * _this.perPage() + 1; + return (_this.currentPageNumber() - 1) * _this.perPage() + 1; }; })(this)); this.to = pureComputed((function(_this) { return function() { var to; - to = _this.currentPage() * _this.perPage(); + to = _this.currentPageNumber() * _this.perPage(); if (to > _this.total()) { return _this.total(); } else { @@ -197,14 +240,13 @@ })(this)); this.recordsText = pureComputed((function(_this) { return function() { - var from, pages, recordWord, recordWordPlural, to, total; - pages = _this.pages(); - total = _this.total(); + var from, recordWord, recordWordPlural, to, total; from = _this.from(); to = _this.to(); + total = _this.total(); recordWord = _this.options.recordWord; recordWordPlural = _this.options.recordWordPlural || recordWord + 's'; - if (pages > 1) { + if (_this.pages().length > 1) { return "" + from + " to " + to + " of " + total + " " + recordWordPlural; } else { return "" + total + " " + (total > 1 || total === 0 ? recordWordPlural : recordWord); @@ -248,7 +290,7 @@ this.replaceRows = (function(_this) { return function(rows) { _this.rows(rows); - _this.currentPage(1); + _this.currentPageNumber(1); return _this.filter(void 0); }; })(this); @@ -352,11 +394,11 @@ return req.send(); }; })(this); - _gatherData = function(perPage, currentPage, filter, sortDir, sortField) { + _gatherData = function(perPage, currentPageNumber, filter, sortDir, sortField) { var data; data = { perPage: perPage, - page: currentPage + page: currentPageNumber }; if ((filter != null) && filter !== '') { data.filter = filter; @@ -372,12 +414,12 @@ this.numFilteredRows = ko.observable(0); this.filter.subscribe((function(_this) { return function() { - return _this.currentPage(1); + return _this.currentPageNumber(1); }; })(this)); this.perPage.subscribe((function(_this) { return function() { - return _this.currentPage(1); + return _this.currentPageNumber(1); }; })(this)); ko.computed((function(_this) { @@ -385,7 +427,7 @@ var data; _this.loading(true); _this.filtering(true); - data = _gatherData(_this.perPage(), _this.currentPage(), _this.filter(), _this.sortDir(), _this.sortField()); + data = _gatherData(_this.perPage(), _this.currentPageNumber(), _this.filter(), _this.sortDir(), _this.sortField()); return _getDataFromServer(data, function(err, response) { var results, total; _this.loading(false); @@ -404,32 +446,47 @@ }); this.pages = pureComputed((function(_this) { return function() { - return Math.ceil(_this.numFilteredRows() / _this.perPage()); + return _this.getPages(_this.numFilteredRows().length, _this.perPage()); + }; + })(this)); + this.limitedPages = pureComputed((function(_this) { + return function() { + return _this.getLimitedPages(_this.pages(), _this.currentPageNumber(), _this.options.paginationLimit); + }; + })(this)); + this.currentPage = pureComputed((function(_this) { + return function() { + return _this.pages()[_this.currentPageNumber() - 1]; + }; + })(this)); + this.pagedRows = pureComputed((function(_this) { + return function() { + return _this.filteredRows().slice(_this.currentPage().start, _this.currentPage().end + 1); }; })(this)); this.leftPagerClass = pureComputed((function(_this) { return function() { - if (_this.currentPage() === 1) { + if (_this.currentPageNumber() === 1) { return 'disabled'; } }; })(this)); this.rightPagerClass = pureComputed((function(_this) { return function() { - if (_this.currentPage() === _this.pages()) { + if (_this.currentPageNumber() === _this.pages().length) { return 'disabled'; } }; })(this)); this.from = pureComputed((function(_this) { return function() { - return (_this.currentPage() - 1) * _this.perPage() + 1; + return (_this.currentPageNumber() - 1) * _this.perPage() + 1; }; })(this)); this.to = pureComputed((function(_this) { return function() { var to, total; - to = _this.currentPage() * _this.perPage(); + to = _this.currentPageNumber() * _this.perPage(); if (to > (total = _this.numFilteredRows())) { return total; } else { @@ -439,14 +496,13 @@ })(this)); this.recordsText = pureComputed((function(_this) { return function() { - var from, pages, recordWord, recordWordPlural, to, total; - pages = _this.pages(); + var from, recordWord, recordWordPlural, to, total; total = _this.numFilteredRows(); from = _this.from(); to = _this.to(); recordWord = _this.options.recordWord; recordWordPlural = _this.options.recordWordPlural || recordWord + 's'; - if (pages > 1) { + if (_this.pages().length > 1) { return "" + from + " to " + to + " of " + total + " " + recordWordPlural; } else { return "" + total + " " + (total > 1 || total === 0 ? recordWordPlural : recordWord); @@ -488,7 +544,7 @@ var data; _this.loading(true); _this.filtering(true); - data = _gatherData(_this.perPage(), _this.currentPage(), _this.filter(), _this.sortDir(), _this.sortField()); + data = _gatherData(_this.perPage(), _this.currentPageNumber(), _this.filter(), _this.sortDir(), _this.sortField()); return _getDataFromServer(data, function(err, response) { var results, total; _this.loading(false); @@ -507,7 +563,7 @@ DataTable.prototype.toggleSort = function(field) { return (function(_this) { return function() { - _this.currentPage(1); + _this.currentPageNumber(1); if (_this.sortField() === field) { return _this.sortDir(_this.sortDir() === 'asc' ? 'desc' : 'asc'); } else { @@ -520,24 +576,24 @@ DataTable.prototype.prevPage = function() { var page; - page = this.currentPage(); + page = this.currentPageNumber(); if (page !== 1) { - return this.currentPage(page - 1); + return this.currentPageNumber(page - 1); } }; DataTable.prototype.nextPage = function() { var page; - page = this.currentPage(); - if (page !== this.pages()) { - return this.currentPage(page + 1); + page = this.currentPageNumber(); + if (page !== this.pages().length) { + return this.currentPageNumber(page + 1); } }; DataTable.prototype.gotoPage = function(page) { return (function(_this) { return function() { - return _this.currentPage(page); + return _this.currentPageNumber(page); }; })(this); }; @@ -545,7 +601,7 @@ DataTable.prototype.pageClass = function(page) { return pureComputed((function(_this) { return function() { - if (_this.currentPage() === page) { + if (_this.currentPageNumber() === page) { return 'active'; } }; @@ -557,3 +613,5 @@ })(); }).call(this); + +//# sourceMappingURL=knockout-datatable.js.map diff --git a/knockout-datatable.min.js b/knockout-datatable.min.js index 6240443..1b21c55 100644 --- a/knockout-datatable.min.js +++ b/knockout-datatable.min.js @@ -1,2 +1,2 @@ -(function(){var a=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};this.DataTable=function(){function b(a,b){var c;if(b||(a instanceof Array?b={}:(b=a,a=[])),this.options={recordWord:b.recordWord||"record",recordWordPlural:b.recordWordPlural,sortDir:b.sortDir||"asc",sortField:b.sortField||void 0,perPage:b.perPage||15,filterFn:b.filterFn||void 0,unsortedClass:b.unsortedClass||"",descSortClass:b.descSortClass||"",ascSortClass:b.ascSortClass||""},this.initObservables(),(c=b.serverSidePagination)&&c.enabled){if(!c.path||!c.loader)throw new Error("`path` or `loader` missing from `serverSidePagination` object");this.options.paginationPath=c.path,this.options.resultHandlerFn=c.loader,this.initWithServerSidePagination()}else this.initWithClientSidePagination(a)}var c,d;return d=ko.pureComputed||ko.computed,c=function(a,b){return null==b?null==a:null!=a?"boolean"==typeof a?a===b:a.toString().toLowerCase().indexOf(b.toString().toLowerCase())>=0||a===b:!1},b.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPage=ko.observable(1),this.filter=ko.observable(""),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},b.prototype.initWithClientSidePagination=function(b){var e;return this.filtering=ko.observable(!1),this.filter.subscribe(function(a){return function(){return a.currentPage(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPage(1)}}(this)),this.rows(b),this.rowAttributeMap=d(function(a){return function(){var c,d,e;if(b=a.rows(),c={},b.length>0){e=b[0];for(d in e)e.hasOwnProperty(d)&&(c[d.toLowerCase()]=d)}return c}}(this)),this.filteredRows=d(function(a){return function(){var c,d;return a.filtering(!0),c=a.filter(),b=a.rows.slice(0),""!==c&&(d=a.filterFn(c),b=b.filter(d)),null!=a.sortField()&&""!==a.sortField()&&b.sort(function(b,c){var d,e;return d=ko.utils.unwrapObservable(b[a.sortField()]),e=ko.utils.unwrapObservable(c[a.sortField()]),"string"==typeof d&&(d=d.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),"asc"===a.sortDir()?e>d||""===d||null==d?-1:d>e||""===e||null==e?1:0:e>d||""===d||null==d?1:d>e||""===e||null==e?-1:0}),a.filtering(!1),b}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pagedRows=d(function(a){return function(){var b,c;return b=a.currentPage()-1,c=a.perPage(),a.filteredRows().slice(b*c,(b+1)*c)}}(this)),this.pages=d(function(a){return function(){return Math.ceil(a.filteredRows().length/a.perPage())}}(this)),this.leftPagerClass=d(function(a){return function(){return 1===a.currentPage()?"disabled":void 0}}(this)),this.rightPagerClass=d(function(a){return function(){return a.currentPage()===a.pages()?"disabled":void 0}}(this)),this.total=d(function(a){return function(){return a.filteredRows().length}}(this)),this.from=d(function(a){return function(){return(a.currentPage()-1)*a.perPage()+1}}(this)),this.to=d(function(a){return function(){var b;return b=a.currentPage()*a.perPage(),b>a.total()?a.total():b}}(this)),this.recordsText=d(function(a){return function(){var b,c,d,e,f,g;return c=a.pages(),g=a.total(),b=a.from(),f=a.to(),d=a.options.recordWord,e=a.options.recordWordPlural||d+"s",c>1?""+b+" to "+f+" of "+g+" "+e:""+g+" "+(g>1||0===g?e:d)}}(this)),this.showNoData=d(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=d(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return d(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(a){return function(b){return a.rows.push(b)}}(this),this.removeRecord=function(a){return function(b){return a.rows.remove(b),0===a.pagedRows().length?a.prevPage():void 0}}(this),this.replaceRows=function(a){return function(b){return a.rows(b),a.currentPage(1),a.filter(void 0)}}(this),e=function(a,b,d){var e,f;return function(){var a;a=[];for(e in d)f=d[e],a.push(f);return a}().some(function(d){return c(ko.isObservable(b[d])?b[d]():b[d],a)})},this.filterFn=this.options.filterFn||function(b){return function(d){var f,g,h;return h=[[],{}],f=h[0],g=h[1],d.split(" ").forEach(function(a){var b;return a.indexOf(":")>=0?(b=a.split(":"),g[b[0]]=function(){switch(b[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return b[1].toLowerCase()}}()):f.push(a)}),f=f.join(" "),function(d){var h,i,j;return h=function(){var a;a=[];for(i in g)j=g[i],a.push(function(a){return function(b,e){var f;return(f=a.rowAttributeMap()[b.toLowerCase()])?c(ko.isObservable(d[f])?d[f]():d[f],e):!1}}(this)(i,j));return a}.call(b),a.call(h,!1)<0&&(""!==f?null!=d.match?d.match(f):e(f,d,b.rowAttributeMap()):!0)}}}(this)},b.prototype.initWithServerSidePagination=function(){var a,b;return b=function(a){return function(b,c){var d,e,f,g;return f=""+a.options.paginationPath+"?"+function(){var a;a=[];for(d in b)g=b[d],a.push(""+encodeURIComponent(d)+"="+encodeURIComponent(g));return a}().join("&"),e=new XMLHttpRequest,e.open("GET",f,!0),e.setRequestHeader("Content-Type","application/json"),e.onload=function(){return e.status>=200&&e.status<400?c(null,JSON.parse(e.responseText)):c(new Error("Error communicating with server"))},e.onerror=function(){return c(new Error("Error communicating with server"))},e.send()}}(this),a=function(a,b,c,d,e){var f;return f={perPage:a,page:b},null!=c&&""!==c&&(f.filter=c),null!=d&&""!==d&&null!=e&&""!==e&&(f.sortDir=d,f.sortBy=e),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(a){return function(){return a.currentPage(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPage(1)}}(this)),ko.computed(function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPage(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=d(function(a){return function(){return Math.ceil(a.numFilteredRows()/a.perPage())}}(this)),this.leftPagerClass=d(function(a){return function(){return 1===a.currentPage()?"disabled":void 0}}(this)),this.rightPagerClass=d(function(a){return function(){return a.currentPage()===a.pages()?"disabled":void 0}}(this)),this.from=d(function(a){return function(){return(a.currentPage()-1)*a.perPage()+1}}(this)),this.to=d(function(a){return function(){var b,c;return b=a.currentPage()*a.perPage(),b>(c=a.numFilteredRows())?c:b}}(this)),this.recordsText=d(function(a){return function(){var b,c,d,e,f,g;return c=a.pages(),g=a.numFilteredRows(),b=a.from(),f=a.to(),d=a.options.recordWord,e=a.options.recordWordPlural||d+"s",c>1?""+b+" to "+f+" of "+g+" "+e:""+g+" "+(g>1||0===g?e:d)}}(this)),this.showNoData=d(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=d(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return d(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled")},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled")},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled")},this.refreshData=function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPage(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)},b.prototype.toggleSort=function(a){return function(b){return function(){return b.currentPage(1),b.sortField()===a?b.sortDir("asc"===b.sortDir()?"desc":"asc"):(b.sortDir("asc"),b.sortField(a))}}(this)},b.prototype.prevPage=function(){var a;return a=this.currentPage(),1!==a?this.currentPage(a-1):void 0},b.prototype.nextPage=function(){var a;return a=this.currentPage(),a!==this.pages()?this.currentPage(a+1):void 0},b.prototype.gotoPage=function(a){return function(b){return function(){return b.currentPage(a)}}(this)},b.prototype.pageClass=function(a){return d(function(b){return function(){return b.currentPage()===a?"active":void 0}}(this))},b}()}).call(this); -//# sourceMappingURL=knockout-datatable.min.js.map \ No newline at end of file +(function(){var n=[].indexOf||function(n){for(var t=0,i=this.length;t=0||n===t:!1},i.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable(""),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},i.prototype.getPages=function(n,t){var r,u,i;for(i=0,r=1,u=new Array(Math.ceil(n/t));in.length)?n.slice(n.length-i,n.length):n.slice(u-1,f)},i.prototype.initWithClientSidePagination=function(i){var u;return this.filtering=ko.observable(!1),this.filter.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),this.rows(i),this.rowAttributeMap=t(function(n){return function(){var r,t,u;if(i=n.rows(),r={},i.length>0){u=i[0];for(t in u)u.hasOwnProperty(t)&&(r[t.toLowerCase()]=t)}return r}}(this)),this.filteredRows=t(function(n){return function(){var t,r;return n.filtering(!0),t=n.filter(),i=n.rows.slice(0),t!==""&&(r=n.filterFn(t),i=i.filter(r)),n.sortField()!=null&&n.sortField()!==""?i.sort(function(t,i){var r,u;return r=ko.utils.unwrapObservable(t[n.sortField()]),u=ko.utils.unwrapObservable(i[n.sortField()]),typeof r=="string"&&(r=r.toLowerCase()),typeof u=="string"&&(u=u.toLowerCase()),n.sortDir()==="asc"?ru||u===""||u==null?1:0:ru||u===""||u==null?-1:0}):i,n.filtering(!1),i}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=t(function(n){return function(){return n.getPages(n.filteredRows().length,n.perPage())}}(this)),this.limitedPages=t(function(n){return function(){return n.getLimitedPages(n.pages(),n.currentPageNumber(),n.options.paginationLimit)}}(this)),this.currentPage=t(function(n){return function(){return n.pages()[n.currentPageNumber()-1]}}(this)),this.pagedRows=t(function(n){return function(){return n.filteredRows().slice(n.currentPage().start,n.currentPage().end+1)}}(this)),this.leftPagerClass=t(function(n){return function(){if(n.currentPageNumber()===1)return"disabled"}}(this)),this.rightPagerClass=t(function(n){return function(){if(n.currentPageNumber()===n.pages().length)return"disabled"}}(this)),this.total=t(function(n){return function(){return n.filteredRows().length}}(this)),this.from=t(function(n){return function(){return(n.currentPageNumber()-1)*n.perPage()+1}}(this)),this.to=t(function(n){return function(){var t;return t=n.currentPageNumber()*n.perPage(),t>n.total()?n.total():t}}(this)),this.recordsText=t(function(n){return function(){var u,i,r,f,t;return u=n.from(),f=n.to(),t=n.total(),i=n.options.recordWord,r=n.options.recordWordPlural||i+"s",n.pages().length>1?""+u+" to "+f+" of "+t+" "+r:""+t+" "+(t>1||t===0?r:i)}}(this)),this.showNoData=t(function(n){return function(){return n.pagedRows().length===0&&!n.loading()}}(this)),this.showLoading=t(function(n){return function(){return n.loading()}}(this)),this.sortClass=function(n){return function(i){return t(function(){return n.sortField()===i?"sorted "+(n.sortDir()==="asc"?n.options.ascSortClass:n.options.descSortClass):n.options.unsortedClass})}}(this),this.addRecord=function(n){return function(t){return n.rows.push(t)}}(this),this.removeRecord=function(n){return function(t){return n.rows.remove(t),n.pagedRows().length===0?n.prevPage():void 0}}(this),this.replaceRows=function(n){return function(t){return n.rows(t),n.currentPageNumber(1),n.filter(void 0)}}(this),u=function(n,t,i){var u,f;return function(){var n=[];for(u in i)f=i[u],n.push(f);return n}().some(function(i){return r(ko.isObservable(t[i])?t[i]():t[i],n)})},this.filterFn=this.options.filterFn||function(t){return function(i){var f,e,o;return o=[[],{}],f=o[0],e=o[1],i.split(" ").forEach(function(n){var t;return n.indexOf(":")>=0?(t=n.split(":"),e[t[0]]=function(){switch(t[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return t[1].toLowerCase()}}()):f.push(n)}),f=f.join(" "),function(i){var s,o,h;return s=function(){var n=[];for(o in e)h=e[o],n.push(function(n){return function(t,u){var f;return(f=n.rowAttributeMap()[t.toLowerCase()])?r(ko.isObservable(i[f])?i[f]():i[f],u):!1}}(this)(o,h));return n}.call(t),n.call(s,!1)<0&&(f!==""?i.match!=null?i.match(f):u(f,i,t.rowAttributeMap()):!0)}}}(this)},i.prototype.initWithServerSidePagination=function(){var n,i;return i=function(n){return function(t,i){var u,r,f,e;return f=""+n.options.paginationPath+"?"+function(){var n=[];for(u in t)e=t[u],n.push(""+encodeURIComponent(u)+"="+encodeURIComponent(e));return n}().join("&"),r=new XMLHttpRequest,r.open("GET",f,!0),r.setRequestHeader("Content-Type","application/json"),r.onload=function(){return r.status>=200&&r.status<400?i(null,JSON.parse(r.responseText)):i(new Error("Error communicating with server"))},r.onerror=function(){return i(new Error("Error communicating with server"))},r.send()}}(this),n=function(n,t,i,r,u){var f;return f={perPage:n,page:t},i!=null&&i!==""&&(f.filter=i),r!=null&&r!==""&&u!=null&&u!==""&&(f.sortDir=r,f.sortBy=u),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),ko.computed(function(t){return function(){var r;return t.loading(!0),t.filtering(!0),r=n(t.perPage(),t.currentPageNumber(),t.filter(),t.sortDir(),t.sortField()),i(r,function(n,i){var r,u;return(t.loading(!1),t.filtering(!1),n)?console.log(n):(u=i.total,r=i.results,t.numFilteredRows(u),t.pagedRows(r.map(t.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=t(function(n){return function(){return n.getPages(n.numFilteredRows().length,n.perPage())}}(this)),this.limitedPages=t(function(n){return function(){return n.getLimitedPages(n.pages(),n.currentPageNumber(),n.options.paginationLimit)}}(this)),this.currentPage=t(function(n){return function(){return n.pages()[n.currentPageNumber()-1]}}(this)),this.pagedRows=t(function(n){return function(){return n.filteredRows().slice(n.currentPage().start,n.currentPage().end+1)}}(this)),this.leftPagerClass=t(function(n){return function(){if(n.currentPageNumber()===1)return"disabled"}}(this)),this.rightPagerClass=t(function(n){return function(){if(n.currentPageNumber()===n.pages().length)return"disabled"}}(this)),this.from=t(function(n){return function(){return(n.currentPageNumber()-1)*n.perPage()+1}}(this)),this.to=t(function(n){return function(){var t,i;return t=n.currentPageNumber()*n.perPage(),t>(i=n.numFilteredRows())?i:t}}(this)),this.recordsText=t(function(n){return function(){var u,i,r,f,t;return t=n.numFilteredRows(),u=n.from(),f=n.to(),i=n.options.recordWord,r=n.options.recordWordPlural||i+"s",n.pages().length>1?""+u+" to "+f+" of "+t+" "+r:""+t+" "+(t>1||t===0?r:i)}}(this)),this.showNoData=t(function(n){return function(){return n.pagedRows().length===0&&!n.loading()}}(this)),this.showLoading=t(function(n){return function(){return n.loading()}}(this)),this.sortClass=function(n){return function(i){return t(function(){return n.sortField()===i?"sorted "+(n.sortDir()==="asc"?n.options.ascSortClass:n.options.descSortClass):n.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled");},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled");},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled");},this.refreshData=function(t){return function(){var r;return t.loading(!0),t.filtering(!0),r=n(t.perPage(),t.currentPageNumber(),t.filter(),t.sortDir(),t.sortField()),i(r,function(n,i){var r,u;return(t.loading(!1),t.filtering(!1),n)?console.log(n):(u=i.total,r=i.results,t.numFilteredRows(u),t.pagedRows(r.map(t.options.resultHandlerFn)))})}}(this)},i.prototype.toggleSort=function(n){return function(t){return function(){return t.currentPageNumber(1),t.sortField()===n?t.sortDir(t.sortDir()==="asc"?"desc":"asc"):(t.sortDir("asc"),t.sortField(n))}}(this)},i.prototype.prevPage=function(){var n;return n=this.currentPageNumber(),n!==1?this.currentPageNumber(n-1):void 0},i.prototype.nextPage=function(){var n;return n=this.currentPageNumber(),n!==this.pages().length?this.currentPageNumber(n+1):void 0},i.prototype.gotoPage=function(n){return function(t){return function(){return t.currentPageNumber(n)}}(this)},i.prototype.pageClass=function(n){return t(function(t){return function(){if(t.currentPageNumber()===n)return"active"}}(this))},i}()}).call(this); +//# sourceMappingURL=knockout-datatable.min.js.map diff --git a/knockout-datatable.min.js.map b/knockout-datatable.min.js.map index dfc2dd9..463920f 100644 --- a/knockout-datatable.min.js.map +++ b/knockout-datatable.min.js.map @@ -1 +1,8 @@ -{"version":3,"file":"knockout-datatable.min.js","sources":["knockout-datatable.js"],"names":["__indexOf","indexOf","item","i","l","this","length","DataTable","rows","options","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","filterFn","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","observable","currentPage","filter","loading","observableArray","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","filteredRows","slice","sort","a","b","aVal","bVal","utils","unwrapObservable","extend","rateLimit","method","pagedRows","pageIndex","pages","Math","ceil","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","status","JSON","parse","responseText","onerror","send","page","sortBy","numFilteredRows","err","response","results","console","log","map","refreshData","toggleSort","field","nextPage","gotoPage","pageClass"],"mappings":"CAAA,WACE,GAAIA,MAAeC,SAAW,SAASC,GAAQ,IAAK,GAAIC,GAAI,EAAGC,EAAIC,KAAKC,OAAYF,EAAJD,EAAOA,IAAO,GAAIA,IAAKE,OAAQA,KAAKF,KAAOD,EAAM,MAAOC,EAAK,OAAO,GAEpJE,MAAKE,UAAY,WAmBf,QAASA,GAAUC,EAAMC,GACvB,GAAIC,EAqBJ,IAp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,CAD3B,CACF,KAAA,CAJsC,CAMzC,CAEDxJ,CAASiC,UAAUwH,SAAU,CAAEC,QAAQ,CAAA,CAAG,CACxC,IAAIF,CAAI,CAER,OADAA,CAAK,CAAE,IAAIpH,kBAAkB,CAAA,CAAE,CAC3BoH,CAAK,GAAI,IAAItG,MAAM,CAAA,CAAEnD,OAArB,CACK,IAAIqC,kBAAkB,CAACoH,CAAK,CAAE,CAAR,CAD3B,CACF,KAAA,CAJsC,CAMzC,CAEDxJ,CAASiC,UAAU0H,SAAU,CAAEC,QAAQ,CAACJ,CAAD,CAAO,CAC5C,OAAQ,QAAQ,CAACzF,CAAD,CAAQ,CACtB,OAAO,QAAQ,CAAA,CAAG,CAChB,OAAOA,CAAK3B,kBAAkB,CAACoH,CAAD,CADd,CADI,CAItB,CAAC,IAAD,CAL0C,CAM7C,CAEDxJ,CAASiC,UAAU4H,UAAW,CAAEC,QAAQ,CAACN,CAAD,CAAO,CAC7C,OAAO9H,CAAY,CAAE,QAAQ,CAACqC,CAAD,CAAQ,CACnC,OAAO,QAAQ,CAAA,CAAG,CAChB,GAAIA,CAAK3B,kBAAkB,CAAA,CAAG,GAAIoH,EAAlC,MACS,QAFO,CADiB,CAMnC,CAAC,IAAD,CANiB,CAD0B,CAQ9C,CAEMxJ,CA/lBoB,CAimB3B,CAAA,CApmBQ,EAsmBVkH,KAAK,CAAC,IAAD,CAAM", +"sources":["knockout-datatable.js"], +"names":[".call","__indexOf","indexOf","item","i","l","length","DataTable","rows","options","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","DataTable.prototype.initObservables","observable","currentPageNumber","filter","loading","observableArray","getPages","DataTable.prototype.getPages","pageNumber","pagesArr","rowIndex","Math","ceil","min","getLimitedPages","DataTable.prototype.getLimitedPages","pages","current","limit","firstPage","lastPage","leftMargin","rightMargin","floor","slice","DataTable.prototype.initWithClientSidePagination","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","extend","limitedPages","currentPage","pagedRows","start","end","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","DataTable.prototype.initWithServerSidePagination","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","req.onload","status","JSON","parse","responseText","onerror","req.onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map",".addRecord",".removeRecord",".replaceRows","refreshData","toggleSort","DataTable.prototype.toggleSort","field","DataTable.prototype.prevPage","page","nextPage","DataTable.prototype.nextPage","gotoPage","DataTable.prototype.gotoPage","pageClass","DataTable.prototype.pageClass"] +} From e239d99d4b0c39558979b51e030a8ecb8ea5f037 Mon Sep 17 00:00:00 2001 From: Ohad Schneider Date: Fri, 13 Mar 2015 21:42:18 +0200 Subject: [PATCH 2/8] Added blank entries. Small refactoring to better take advantage of pages array. --- demo.html | 24 ++++++++++++ knockout-datatable.coffee | 72 ++++++++++++++--------------------- knockout-datatable.js | 55 +++++++++++++------------- knockout-datatable.min.js | 2 +- knockout-datatable.min.js.map | 4 +- 5 files changed, 81 insertions(+), 76 deletions(-) diff --git a/demo.html b/demo.html index 0543d1e..9be3780 100644 --- a/demo.html +++ b/demo.html @@ -275,6 +275,13 @@

Simple example

<td data-bind="text: $row.population"></td> </tr> <!-- /ko --> + <!-- ko foreach: {data: currentPage().blanks} --> + <tr> + <td>-</td> + <td>-</td> + <td>-</td> + </tr> + <!-- /ko --> </tbody> </table> <span data-bind="text: recordsText" class="label label-info pull-right"></span> @@ -343,6 +350,13 @@

Result:

+ + + - + - + - + + @@ -409,6 +423,13 @@

Example without sorting

+ + + - + - + - + + @@ -453,6 +474,9 @@

Options

perPage
Integer indicating the number of rows to be shown per page. Default: 15
+
paginationLimit
+
Integer indicating the number of pages to include in the table.limitedPages observable array. Default: 10
+
unsortedClass
descSortClass
ascSortClass
The classes given to the icons in the th elements indicating the direction of sorting. Set to '' if you would rather have no icons. Default: '' for each
diff --git a/knockout-datatable.coffee b/knockout-datatable.coffee index cf4326b..3f28ee5 100644 --- a/knockout-datatable.coffee +++ b/knockout-datatable.coffee @@ -58,24 +58,32 @@ class @DataTable @loading = ko.observable false @rows = ko.observableArray [] - getPages: (rows, perPage) -> + getPages: (rowCount) => + perPage = @perPage() rowIndex = 0 pageNumber = 1 - pagesArr = new Array(Math.ceil rows / perPage) - while rowIndex < rows - pagesArr[pageNumber - 1] = + pagesArr = new Array(Math.ceil(rowCount / perPage)) + while rowIndex < rowCount + page = number: pageNumber start: rowIndex - end: Math.min rows-1, rowIndex+perPage-1 + end: Math.min(rowCount-1, rowIndex+perPage-1) + page.blanks = new Array(if pagesArr.length > 1 then perPage-(page.end-page.start+1) else 0) + pagesArr[pageNumber-1] = page + pageNumber++ rowIndex += perPage - pagesArr - getLimitedPages: (pages, current, limit) -> + return pagesArr + + getLimitedPages: () => + pages = @pages() + current = @currentPageNumber() + limit = @options.paginationLimit if (pages.length <= limit) return pages - leftMargin = Math.floor(limit/2); + leftMargin = Math.floor(limit/2) firstPage = current - Math.floor(leftMargin) if (firstPage < 1) return pages.slice(0, limit) @@ -135,30 +143,18 @@ class @DataTable .extend {rateLimit: 50, method: 'notifyWhenChangesStop'} - @pages = pureComputed => - @getPages @filteredRows().length, @perPage() - - @limitedPages = pureComputed => - @getLimitedPages @pages(), @currentPageNumber(), @options.paginationLimit - - @currentPage = pureComputed => - @pages()[@currentPageNumber() - 1] - - @pagedRows = pureComputed => - @filteredRows().slice @currentPage().start, @currentPage().end + 1 + @pages = pureComputed => @getPages @filteredRows().length + @limitedPages = pureComputed => @getLimitedPages() + @currentPage = pureComputed => @pages()[@currentPageNumber() - 1] + @pagedRows = pureComputed => @filteredRows().slice(@currentPage().start, @currentPage().end + 1) @leftPagerClass = pureComputed => 'disabled' if @currentPageNumber() is 1 @rightPagerClass = pureComputed => 'disabled' if @currentPageNumber() is @pages().length # info @total = pureComputed => @filteredRows().length - @from = pureComputed => (@currentPageNumber() - 1) * @perPage() + 1 - @to = pureComputed => - to = @currentPageNumber() * @perPage() - if to > @total() - @total() - else - to + @from = pureComputed => @currentPage().start + 1 + @to = pureComputed => @currentPage().end + 1 @recordsText = pureComputed => from = @from() @@ -282,29 +278,17 @@ class @DataTable .extend {rateLimit: 500, method: 'notifyWhenChangesStop'} - @pages = pureComputed => - @getPages @numFilteredRows().length, @perPage() - - @limitedPages = pureComputed => - @getLimitedPages @pages(), @currentPageNumber(), @options.paginationLimit - - @currentPage = pureComputed => - @pages()[@currentPageNumber() - 1] - - @pagedRows = pureComputed => - @filteredRows().slice @currentPage().start, @currentPage().end + 1 + @pages = pureComputed => @getPages @numFilteredRows() + @limitedPages = pureComputed => @getLimitedPages() + @currentPage = pureComputed => @pages()[@currentPageNumber() - 1] + @pagedRows = pureComputed => @filteredRows().slice(@currentPage().start, @currentPage().end + 1) @leftPagerClass = pureComputed => 'disabled' if @currentPageNumber() is 1 @rightPagerClass = pureComputed => 'disabled' if @currentPageNumber() is @pages().length # info - @from = pureComputed => (@currentPageNumber() - 1) * @perPage() + 1 - @to = pureComputed => - to = @currentPageNumber() * @perPage() - if to > (total = @numFilteredRows()) - total - else - to + @from = pureComputed => @currentPage().start + 1 + @to = pureComputed => @currentPage().end + 1 @recordsText = pureComputed => total = @numFilteredRows() diff --git a/knockout-datatable.js b/knockout-datatable.js index c267dbd..8bee1a9 100644 --- a/knockout-datatable.js +++ b/knockout-datatable.js @@ -1,5 +1,6 @@ (function() { - var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; this.DataTable = (function() { var primitiveCompare, pureComputed; @@ -21,6 +22,8 @@ }; function DataTable(rows, options) { + this.getLimitedPages = __bind(this.getLimitedPages, this); + this.getPages = __bind(this.getPages, this); var serverSideOpts; if (!options) { if (!(rows instanceof Array)) { @@ -65,25 +68,31 @@ return this.rows = ko.observableArray([]); }; - DataTable.prototype.getPages = function(rows, perPage) { - var pageNumber, pagesArr, rowIndex; + DataTable.prototype.getPages = function(rowCount) { + var page, pageNumber, pagesArr, perPage, rowIndex; + perPage = this.perPage(); rowIndex = 0; pageNumber = 1; - pagesArr = new Array(Math.ceil(rows / perPage)); - while (rowIndex < rows) { - pagesArr[pageNumber - 1] = { + pagesArr = new Array(Math.ceil(rowCount / perPage)); + while (rowIndex < rowCount) { + page = { number: pageNumber, start: rowIndex, - end: Math.min(rows - 1, rowIndex + perPage - 1) + end: Math.min(rowCount - 1, rowIndex + perPage - 1) }; + page.blanks = new Array(pagesArr.length > 1 ? perPage - (page.end - page.start + 1) : 0); + pagesArr[pageNumber - 1] = page; pageNumber++; rowIndex += perPage; } return pagesArr; }; - DataTable.prototype.getLimitedPages = function(pages, current, limit) { - var firstPage, lastPage, leftMargin, rightMargin; + DataTable.prototype.getLimitedPages = function() { + var current, firstPage, lastPage, leftMargin, limit, pages, rightMargin; + pages = this.pages(); + current = this.currentPageNumber(); + limit = this.options.paginationLimit; if (pages.length <= limit) { return pages; } @@ -185,12 +194,12 @@ }); this.pages = pureComputed((function(_this) { return function() { - return _this.getPages(_this.filteredRows().length, _this.perPage()); + return _this.getPages(_this.filteredRows().length); }; })(this)); this.limitedPages = pureComputed((function(_this) { return function() { - return _this.getLimitedPages(_this.pages(), _this.currentPageNumber(), _this.options.paginationLimit); + return _this.getLimitedPages(); }; })(this)); this.currentPage = pureComputed((function(_this) { @@ -224,18 +233,12 @@ })(this)); this.from = pureComputed((function(_this) { return function() { - return (_this.currentPageNumber() - 1) * _this.perPage() + 1; + return _this.currentPage().start + 1; }; })(this)); this.to = pureComputed((function(_this) { return function() { - var to; - to = _this.currentPageNumber() * _this.perPage(); - if (to > _this.total()) { - return _this.total(); - } else { - return to; - } + return _this.currentPage().end + 1; }; })(this)); this.recordsText = pureComputed((function(_this) { @@ -446,12 +449,12 @@ }); this.pages = pureComputed((function(_this) { return function() { - return _this.getPages(_this.numFilteredRows().length, _this.perPage()); + return _this.getPages(_this.numFilteredRows()); }; })(this)); this.limitedPages = pureComputed((function(_this) { return function() { - return _this.getLimitedPages(_this.pages(), _this.currentPageNumber(), _this.options.paginationLimit); + return _this.getLimitedPages(); }; })(this)); this.currentPage = pureComputed((function(_this) { @@ -480,18 +483,12 @@ })(this)); this.from = pureComputed((function(_this) { return function() { - return (_this.currentPageNumber() - 1) * _this.perPage() + 1; + return _this.currentPage().start + 1; }; })(this)); this.to = pureComputed((function(_this) { return function() { - var to, total; - to = _this.currentPageNumber() * _this.perPage(); - if (to > (total = _this.numFilteredRows())) { - return total; - } else { - return to; - } + return _this.currentPage().end + 1; }; })(this)); this.recordsText = pureComputed((function(_this) { diff --git a/knockout-datatable.min.js b/knockout-datatable.min.js index 1b21c55..b78dd6b 100644 --- a/knockout-datatable.min.js +++ b/knockout-datatable.min.js @@ -1,2 +1,2 @@ -(function(){var n=[].indexOf||function(n){for(var t=0,i=this.length;t=0||n===t:!1},i.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable(""),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},i.prototype.getPages=function(n,t){var r,u,i;for(i=0,r=1,u=new Array(Math.ceil(n/t));in.length)?n.slice(n.length-i,n.length):n.slice(u-1,f)},i.prototype.initWithClientSidePagination=function(i){var u;return this.filtering=ko.observable(!1),this.filter.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),this.rows(i),this.rowAttributeMap=t(function(n){return function(){var r,t,u;if(i=n.rows(),r={},i.length>0){u=i[0];for(t in u)u.hasOwnProperty(t)&&(r[t.toLowerCase()]=t)}return r}}(this)),this.filteredRows=t(function(n){return function(){var t,r;return n.filtering(!0),t=n.filter(),i=n.rows.slice(0),t!==""&&(r=n.filterFn(t),i=i.filter(r)),n.sortField()!=null&&n.sortField()!==""?i.sort(function(t,i){var r,u;return r=ko.utils.unwrapObservable(t[n.sortField()]),u=ko.utils.unwrapObservable(i[n.sortField()]),typeof r=="string"&&(r=r.toLowerCase()),typeof u=="string"&&(u=u.toLowerCase()),n.sortDir()==="asc"?ru||u===""||u==null?1:0:ru||u===""||u==null?-1:0}):i,n.filtering(!1),i}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=t(function(n){return function(){return n.getPages(n.filteredRows().length,n.perPage())}}(this)),this.limitedPages=t(function(n){return function(){return n.getLimitedPages(n.pages(),n.currentPageNumber(),n.options.paginationLimit)}}(this)),this.currentPage=t(function(n){return function(){return n.pages()[n.currentPageNumber()-1]}}(this)),this.pagedRows=t(function(n){return function(){return n.filteredRows().slice(n.currentPage().start,n.currentPage().end+1)}}(this)),this.leftPagerClass=t(function(n){return function(){if(n.currentPageNumber()===1)return"disabled"}}(this)),this.rightPagerClass=t(function(n){return function(){if(n.currentPageNumber()===n.pages().length)return"disabled"}}(this)),this.total=t(function(n){return function(){return n.filteredRows().length}}(this)),this.from=t(function(n){return function(){return(n.currentPageNumber()-1)*n.perPage()+1}}(this)),this.to=t(function(n){return function(){var t;return t=n.currentPageNumber()*n.perPage(),t>n.total()?n.total():t}}(this)),this.recordsText=t(function(n){return function(){var u,i,r,f,t;return u=n.from(),f=n.to(),t=n.total(),i=n.options.recordWord,r=n.options.recordWordPlural||i+"s",n.pages().length>1?""+u+" to "+f+" of "+t+" "+r:""+t+" "+(t>1||t===0?r:i)}}(this)),this.showNoData=t(function(n){return function(){return n.pagedRows().length===0&&!n.loading()}}(this)),this.showLoading=t(function(n){return function(){return n.loading()}}(this)),this.sortClass=function(n){return function(i){return t(function(){return n.sortField()===i?"sorted "+(n.sortDir()==="asc"?n.options.ascSortClass:n.options.descSortClass):n.options.unsortedClass})}}(this),this.addRecord=function(n){return function(t){return n.rows.push(t)}}(this),this.removeRecord=function(n){return function(t){return n.rows.remove(t),n.pagedRows().length===0?n.prevPage():void 0}}(this),this.replaceRows=function(n){return function(t){return n.rows(t),n.currentPageNumber(1),n.filter(void 0)}}(this),u=function(n,t,i){var u,f;return function(){var n=[];for(u in i)f=i[u],n.push(f);return n}().some(function(i){return r(ko.isObservable(t[i])?t[i]():t[i],n)})},this.filterFn=this.options.filterFn||function(t){return function(i){var f,e,o;return o=[[],{}],f=o[0],e=o[1],i.split(" ").forEach(function(n){var t;return n.indexOf(":")>=0?(t=n.split(":"),e[t[0]]=function(){switch(t[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return t[1].toLowerCase()}}()):f.push(n)}),f=f.join(" "),function(i){var s,o,h;return s=function(){var n=[];for(o in e)h=e[o],n.push(function(n){return function(t,u){var f;return(f=n.rowAttributeMap()[t.toLowerCase()])?r(ko.isObservable(i[f])?i[f]():i[f],u):!1}}(this)(o,h));return n}.call(t),n.call(s,!1)<0&&(f!==""?i.match!=null?i.match(f):u(f,i,t.rowAttributeMap()):!0)}}}(this)},i.prototype.initWithServerSidePagination=function(){var n,i;return i=function(n){return function(t,i){var u,r,f,e;return f=""+n.options.paginationPath+"?"+function(){var n=[];for(u in t)e=t[u],n.push(""+encodeURIComponent(u)+"="+encodeURIComponent(e));return n}().join("&"),r=new XMLHttpRequest,r.open("GET",f,!0),r.setRequestHeader("Content-Type","application/json"),r.onload=function(){return r.status>=200&&r.status<400?i(null,JSON.parse(r.responseText)):i(new Error("Error communicating with server"))},r.onerror=function(){return i(new Error("Error communicating with server"))},r.send()}}(this),n=function(n,t,i,r,u){var f;return f={perPage:n,page:t},i!=null&&i!==""&&(f.filter=i),r!=null&&r!==""&&u!=null&&u!==""&&(f.sortDir=r,f.sortBy=u),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),ko.computed(function(t){return function(){var r;return t.loading(!0),t.filtering(!0),r=n(t.perPage(),t.currentPageNumber(),t.filter(),t.sortDir(),t.sortField()),i(r,function(n,i){var r,u;return(t.loading(!1),t.filtering(!1),n)?console.log(n):(u=i.total,r=i.results,t.numFilteredRows(u),t.pagedRows(r.map(t.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=t(function(n){return function(){return n.getPages(n.numFilteredRows().length,n.perPage())}}(this)),this.limitedPages=t(function(n){return function(){return n.getLimitedPages(n.pages(),n.currentPageNumber(),n.options.paginationLimit)}}(this)),this.currentPage=t(function(n){return function(){return n.pages()[n.currentPageNumber()-1]}}(this)),this.pagedRows=t(function(n){return function(){return n.filteredRows().slice(n.currentPage().start,n.currentPage().end+1)}}(this)),this.leftPagerClass=t(function(n){return function(){if(n.currentPageNumber()===1)return"disabled"}}(this)),this.rightPagerClass=t(function(n){return function(){if(n.currentPageNumber()===n.pages().length)return"disabled"}}(this)),this.from=t(function(n){return function(){return(n.currentPageNumber()-1)*n.perPage()+1}}(this)),this.to=t(function(n){return function(){var t,i;return t=n.currentPageNumber()*n.perPage(),t>(i=n.numFilteredRows())?i:t}}(this)),this.recordsText=t(function(n){return function(){var u,i,r,f,t;return t=n.numFilteredRows(),u=n.from(),f=n.to(),i=n.options.recordWord,r=n.options.recordWordPlural||i+"s",n.pages().length>1?""+u+" to "+f+" of "+t+" "+r:""+t+" "+(t>1||t===0?r:i)}}(this)),this.showNoData=t(function(n){return function(){return n.pagedRows().length===0&&!n.loading()}}(this)),this.showLoading=t(function(n){return function(){return n.loading()}}(this)),this.sortClass=function(n){return function(i){return t(function(){return n.sortField()===i?"sorted "+(n.sortDir()==="asc"?n.options.ascSortClass:n.options.descSortClass):n.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled");},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled");},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled");},this.refreshData=function(t){return function(){var r;return t.loading(!0),t.filtering(!0),r=n(t.perPage(),t.currentPageNumber(),t.filter(),t.sortDir(),t.sortField()),i(r,function(n,i){var r,u;return(t.loading(!1),t.filtering(!1),n)?console.log(n):(u=i.total,r=i.results,t.numFilteredRows(u),t.pagedRows(r.map(t.options.resultHandlerFn)))})}}(this)},i.prototype.toggleSort=function(n){return function(t){return function(){return t.currentPageNumber(1),t.sortField()===n?t.sortDir(t.sortDir()==="asc"?"desc":"asc"):(t.sortDir("asc"),t.sortField(n))}}(this)},i.prototype.prevPage=function(){var n;return n=this.currentPageNumber(),n!==1?this.currentPageNumber(n-1):void 0},i.prototype.nextPage=function(){var n;return n=this.currentPageNumber(),n!==this.pages().length?this.currentPageNumber(n+1):void 0},i.prototype.gotoPage=function(n){return function(t){return function(){return t.currentPageNumber(n)}}(this)},i.prototype.pageClass=function(n){return t(function(t){return function(){if(t.currentPageNumber()===n)return"active"}}(this))},i}()}).call(this); +(function(){var n=function(n,t){return function(){return n.apply(t,arguments)}},t=[].indexOf||function(n){for(var t=0,i=this.length;t=0||n===t:!1},r.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable(""),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},r.prototype.getPages=function(n){var t,u,f,i,r;for(i=this.perPage(),r=0,u=1,f=new Array(Math.ceil(n/i));r1?i-(t.end-t.start+1):0),f[u-1]=t,u++,r+=i;return f},r.prototype.getLimitedPages=function(){var r,u,f,i,t,n,e;return(n=this.pages(),r=this.currentPageNumber(),t=this.options.paginationLimit,n.length<=t)?n:(i=Math.floor(t/2),u=r-Math.floor(i),u<1)?n.slice(0,t):(e=t%2==0?i-1:i,f=r+e,f>n.length)?n.slice(n.length-t,n.length):n.slice(u-1,f)},r.prototype.initWithClientSidePagination=function(n){var r;return this.filtering=ko.observable(!1),this.filter.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),this.rows(n),this.rowAttributeMap=i(function(t){return function(){var r,i,u;if(n=t.rows(),r={},n.length>0){u=n[0];for(i in u)u.hasOwnProperty(i)&&(r[i.toLowerCase()]=i)}return r}}(this)),this.filteredRows=i(function(t){return function(){var i,r;return t.filtering(!0),i=t.filter(),n=t.rows.slice(0),i!==""&&(r=t.filterFn(i),n=n.filter(r)),t.sortField()!=null&&t.sortField()!==""?n.sort(function(n,i){var r,u;return r=ko.utils.unwrapObservable(n[t.sortField()]),u=ko.utils.unwrapObservable(i[t.sortField()]),typeof r=="string"&&(r=r.toLowerCase()),typeof u=="string"&&(u=u.toLowerCase()),t.sortDir()==="asc"?ru||u===""||u==null?1:0:ru||u===""||u==null?-1:0}):n,t.filtering(!1),n}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=i(function(n){return function(){return n.getPages(n.filteredRows().length)}}(this)),this.limitedPages=i(function(n){return function(){return n.getLimitedPages()}}(this)),this.currentPage=i(function(n){return function(){return n.pages()[n.currentPageNumber()-1]}}(this)),this.pagedRows=i(function(n){return function(){return n.filteredRows().slice(n.currentPage().start,n.currentPage().end+1)}}(this)),this.leftPagerClass=i(function(n){return function(){if(n.currentPageNumber()===1)return"disabled"}}(this)),this.rightPagerClass=i(function(n){return function(){if(n.currentPageNumber()===n.pages().length)return"disabled"}}(this)),this.total=i(function(n){return function(){return n.filteredRows().length}}(this)),this.from=i(function(n){return function(){return n.currentPage().start+1}}(this)),this.to=i(function(n){return function(){return n.currentPage().end+1}}(this)),this.recordsText=i(function(n){return function(){var u,i,r,f,t;return u=n.from(),f=n.to(),t=n.total(),i=n.options.recordWord,r=n.options.recordWordPlural||i+"s",n.pages().length>1?""+u+" to "+f+" of "+t+" "+r:""+t+" "+(t>1||t===0?r:i)}}(this)),this.showNoData=i(function(n){return function(){return n.pagedRows().length===0&&!n.loading()}}(this)),this.showLoading=i(function(n){return function(){return n.loading()}}(this)),this.sortClass=function(n){return function(t){return i(function(){return n.sortField()===t?"sorted "+(n.sortDir()==="asc"?n.options.ascSortClass:n.options.descSortClass):n.options.unsortedClass})}}(this),this.addRecord=function(n){return function(t){return n.rows.push(t)}}(this),this.removeRecord=function(n){return function(t){return n.rows.remove(t),n.pagedRows().length===0?n.prevPage():void 0}}(this),this.replaceRows=function(n){return function(t){return n.rows(t),n.currentPageNumber(1),n.filter(void 0)}}(this),r=function(n,t,i){var r,f;return function(){var n=[];for(r in i)f=i[r],n.push(f);return n}().some(function(i){return u(ko.isObservable(t[i])?t[i]():t[i],n)})},this.filterFn=this.options.filterFn||function(n){return function(i){var f,e,o;return o=[[],{}],f=o[0],e=o[1],i.split(" ").forEach(function(n){var t;return n.indexOf(":")>=0?(t=n.split(":"),e[t[0]]=function(){switch(t[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return t[1].toLowerCase()}}()):f.push(n)}),f=f.join(" "),function(i){var s,o,h;return s=function(){var n=[];for(o in e)h=e[o],n.push(function(n){return function(t,r){var f;return(f=n.rowAttributeMap()[t.toLowerCase()])?u(ko.isObservable(i[f])?i[f]():i[f],r):!1}}(this)(o,h));return n}.call(n),t.call(s,!1)<0&&(f!==""?i.match!=null?i.match(f):r(f,i,n.rowAttributeMap()):!0)}}}(this)},r.prototype.initWithServerSidePagination=function(){var n,t;return t=function(n){return function(t,i){var u,r,f,e;return f=""+n.options.paginationPath+"?"+function(){var n=[];for(u in t)e=t[u],n.push(""+encodeURIComponent(u)+"="+encodeURIComponent(e));return n}().join("&"),r=new XMLHttpRequest,r.open("GET",f,!0),r.setRequestHeader("Content-Type","application/json"),r.onload=function(){return r.status>=200&&r.status<400?i(null,JSON.parse(r.responseText)):i(new Error("Error communicating with server"))},r.onerror=function(){return i(new Error("Error communicating with server"))},r.send()}}(this),n=function(n,t,i,r,u){var f;return f={perPage:n,page:t},i!=null&&i!==""&&(f.filter=i),r!=null&&r!==""&&u!=null&&u!==""&&(f.sortDir=r,f.sortBy=u),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),ko.computed(function(i){return function(){var r;return i.loading(!0),i.filtering(!0),r=n(i.perPage(),i.currentPageNumber(),i.filter(),i.sortDir(),i.sortField()),t(r,function(n,t){var r,u;return(i.loading(!1),i.filtering(!1),n)?console.log(n):(u=t.total,r=t.results,i.numFilteredRows(u),i.pagedRows(r.map(i.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=i(function(n){return function(){return n.getPages(n.numFilteredRows())}}(this)),this.limitedPages=i(function(n){return function(){return n.getLimitedPages()}}(this)),this.currentPage=i(function(n){return function(){return n.pages()[n.currentPageNumber()-1]}}(this)),this.pagedRows=i(function(n){return function(){return n.filteredRows().slice(n.currentPage().start,n.currentPage().end+1)}}(this)),this.leftPagerClass=i(function(n){return function(){if(n.currentPageNumber()===1)return"disabled"}}(this)),this.rightPagerClass=i(function(n){return function(){if(n.currentPageNumber()===n.pages().length)return"disabled"}}(this)),this.from=i(function(n){return function(){return n.currentPage().start+1}}(this)),this.to=i(function(n){return function(){return n.currentPage().end+1}}(this)),this.recordsText=i(function(n){return function(){var u,i,r,f,t;return t=n.numFilteredRows(),u=n.from(),f=n.to(),i=n.options.recordWord,r=n.options.recordWordPlural||i+"s",n.pages().length>1?""+u+" to "+f+" of "+t+" "+r:""+t+" "+(t>1||t===0?r:i)}}(this)),this.showNoData=i(function(n){return function(){return n.pagedRows().length===0&&!n.loading()}}(this)),this.showLoading=i(function(n){return function(){return n.loading()}}(this)),this.sortClass=function(n){return function(t){return i(function(){return n.sortField()===t?"sorted "+(n.sortDir()==="asc"?n.options.ascSortClass:n.options.descSortClass):n.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled");},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled");},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled");},this.refreshData=function(i){return function(){var r;return i.loading(!0),i.filtering(!0),r=n(i.perPage(),i.currentPageNumber(),i.filter(),i.sortDir(),i.sortField()),t(r,function(n,t){var r,u;return(i.loading(!1),i.filtering(!1),n)?console.log(n):(u=t.total,r=t.results,i.numFilteredRows(u),i.pagedRows(r.map(i.options.resultHandlerFn)))})}}(this)},r.prototype.toggleSort=function(n){return function(t){return function(){return t.currentPageNumber(1),t.sortField()===n?t.sortDir(t.sortDir()==="asc"?"desc":"asc"):(t.sortDir("asc"),t.sortField(n))}}(this)},r.prototype.prevPage=function(){var n;return n=this.currentPageNumber(),n!==1?this.currentPageNumber(n-1):void 0},r.prototype.nextPage=function(){var n;return n=this.currentPageNumber(),n!==this.pages().length?this.currentPageNumber(n+1):void 0},r.prototype.gotoPage=function(n){return function(t){return function(){return t.currentPageNumber(n)}}(this)},r.prototype.pageClass=function(n){return i(function(t){return function(){if(t.currentPageNumber()===n)return"active"}}(this))},r}()}).call(this); //# sourceMappingURL=knockout-datatable.min.js.map diff --git a/knockout-datatable.min.js.map b/knockout-datatable.min.js.map index 463920f..b713aa1 100644 --- a/knockout-datatable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CADI,CAItB,CAAC,IAAD,CAL0C,CAM7C,CAED5C,CAASmC,UAAU4H,UAAW,CAAEC,QAAQ,CAACpH,CAAD,CAAO,CAC7C,OAAOhB,CAAY,CAAE,QAAQ,CAACwC,CAAD,CAAQ,CACnC,OAAO,QAAQ,CAAA,CAAG,CAChB,GAAIA,CAAK9B,kBAAkB,CAAA,CAAG,GAAIM,EAAlC,MACS,QAFO,CADiB,CAMnC,CAAC,IAAD,CANiB,CAD0B,CAQ9C,CAEM5C,CA3lBoB,CA6lB3B,CAAA,CAjmBQ,EAmmBVqH,KAAK,CAAC,IAAD,CAAM", "sources":["knockout-datatable.js"], -"names":[".call","__indexOf","indexOf","item","i","l","length","DataTable","rows","options","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","DataTable.prototype.initObservables","observable","currentPageNumber","filter","loading","observableArray","getPages","DataTable.prototype.getPages","pageNumber","pagesArr","rowIndex","Math","ceil","min","getLimitedPages","DataTable.prototype.getLimitedPages","pages","current","limit","firstPage","lastPage","leftMargin","rightMargin","floor","slice","DataTable.prototype.initWithClientSidePagination","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","extend","limitedPages","currentPage","pagedRows","start","end","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","DataTable.prototype.initWithServerSidePagination","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","req.onload","status","JSON","parse","responseText","onerror","req.onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map",".addRecord",".removeRecord",".replaceRows","refreshData","toggleSort","DataTable.prototype.toggleSort","field","DataTable.prototype.prevPage","page","nextPage","DataTable.prototype.nextPage","gotoPage","DataTable.prototype.gotoPage","pageClass","DataTable.prototype.pageClass"] +"names":[".call","__bind","fn","me","apply","arguments","__indexOf","indexOf","item","i","l","length","DataTable","rows","options","getLimitedPages","getPages","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","DataTable.prototype.initObservables","observable","currentPageNumber","filter","loading","observableArray","DataTable.prototype.getPages","rowCount","page","pageNumber","pagesArr","rowIndex","Math","ceil","min","blanks","end","start","DataTable.prototype.getLimitedPages","current","firstPage","lastPage","leftMargin","limit","pages","rightMargin","floor","slice","DataTable.prototype.initWithClientSidePagination","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","extend","limitedPages","currentPage","pagedRows","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","DataTable.prototype.initWithServerSidePagination","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","req.onload","status","JSON","parse","responseText","onerror","req.onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map",".addRecord",".removeRecord",".replaceRows","refreshData","toggleSort","DataTable.prototype.toggleSort","field","DataTable.prototype.prevPage","nextPage","DataTable.prototype.nextPage","gotoPage","DataTable.prototype.gotoPage","pageClass","DataTable.prototype.pageClass"] } From 54c75665d1030860d7e8c9a391eebf7bf78aee64 Mon Sep 17 00:00:00 2001 From: Ohad Schneider Date: Fri, 13 Mar 2015 23:57:58 +0200 Subject: [PATCH 3/8] grunt generated files --- knockout-datatable.js | 4 +--- knockout-datatable.min.js | 4 ++-- knockout-datatable.min.js.map | 9 +-------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/knockout-datatable.js b/knockout-datatable.js index 8bee1a9..5e48ad3 100644 --- a/knockout-datatable.js +++ b/knockout-datatable.js @@ -1,4 +1,4 @@ -(function() { +(function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; @@ -610,5 +610,3 @@ })(); }).call(this); - -//# sourceMappingURL=knockout-datatable.js.map diff --git a/knockout-datatable.min.js b/knockout-datatable.min.js index b78dd6b..5708a78 100644 --- a/knockout-datatable.min.js +++ b/knockout-datatable.min.js @@ -1,2 +1,2 @@ -(function(){var n=function(n,t){return function(){return n.apply(t,arguments)}},t=[].indexOf||function(n){for(var t=0,i=this.length;t=0||n===t:!1},r.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable(""),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},r.prototype.getPages=function(n){var t,u,f,i,r;for(i=this.perPage(),r=0,u=1,f=new Array(Math.ceil(n/i));r1?i-(t.end-t.start+1):0),f[u-1]=t,u++,r+=i;return f},r.prototype.getLimitedPages=function(){var r,u,f,i,t,n,e;return(n=this.pages(),r=this.currentPageNumber(),t=this.options.paginationLimit,n.length<=t)?n:(i=Math.floor(t/2),u=r-Math.floor(i),u<1)?n.slice(0,t):(e=t%2==0?i-1:i,f=r+e,f>n.length)?n.slice(n.length-t,n.length):n.slice(u-1,f)},r.prototype.initWithClientSidePagination=function(n){var r;return this.filtering=ko.observable(!1),this.filter.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),this.rows(n),this.rowAttributeMap=i(function(t){return function(){var r,i,u;if(n=t.rows(),r={},n.length>0){u=n[0];for(i in u)u.hasOwnProperty(i)&&(r[i.toLowerCase()]=i)}return r}}(this)),this.filteredRows=i(function(t){return function(){var i,r;return t.filtering(!0),i=t.filter(),n=t.rows.slice(0),i!==""&&(r=t.filterFn(i),n=n.filter(r)),t.sortField()!=null&&t.sortField()!==""?n.sort(function(n,i){var r,u;return r=ko.utils.unwrapObservable(n[t.sortField()]),u=ko.utils.unwrapObservable(i[t.sortField()]),typeof r=="string"&&(r=r.toLowerCase()),typeof u=="string"&&(u=u.toLowerCase()),t.sortDir()==="asc"?ru||u===""||u==null?1:0:ru||u===""||u==null?-1:0}):n,t.filtering(!1),n}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=i(function(n){return function(){return n.getPages(n.filteredRows().length)}}(this)),this.limitedPages=i(function(n){return function(){return n.getLimitedPages()}}(this)),this.currentPage=i(function(n){return function(){return n.pages()[n.currentPageNumber()-1]}}(this)),this.pagedRows=i(function(n){return function(){return n.filteredRows().slice(n.currentPage().start,n.currentPage().end+1)}}(this)),this.leftPagerClass=i(function(n){return function(){if(n.currentPageNumber()===1)return"disabled"}}(this)),this.rightPagerClass=i(function(n){return function(){if(n.currentPageNumber()===n.pages().length)return"disabled"}}(this)),this.total=i(function(n){return function(){return n.filteredRows().length}}(this)),this.from=i(function(n){return function(){return n.currentPage().start+1}}(this)),this.to=i(function(n){return function(){return n.currentPage().end+1}}(this)),this.recordsText=i(function(n){return function(){var u,i,r,f,t;return u=n.from(),f=n.to(),t=n.total(),i=n.options.recordWord,r=n.options.recordWordPlural||i+"s",n.pages().length>1?""+u+" to "+f+" of "+t+" "+r:""+t+" "+(t>1||t===0?r:i)}}(this)),this.showNoData=i(function(n){return function(){return n.pagedRows().length===0&&!n.loading()}}(this)),this.showLoading=i(function(n){return function(){return n.loading()}}(this)),this.sortClass=function(n){return function(t){return i(function(){return n.sortField()===t?"sorted "+(n.sortDir()==="asc"?n.options.ascSortClass:n.options.descSortClass):n.options.unsortedClass})}}(this),this.addRecord=function(n){return function(t){return n.rows.push(t)}}(this),this.removeRecord=function(n){return function(t){return n.rows.remove(t),n.pagedRows().length===0?n.prevPage():void 0}}(this),this.replaceRows=function(n){return function(t){return n.rows(t),n.currentPageNumber(1),n.filter(void 0)}}(this),r=function(n,t,i){var r,f;return function(){var n=[];for(r in i)f=i[r],n.push(f);return n}().some(function(i){return u(ko.isObservable(t[i])?t[i]():t[i],n)})},this.filterFn=this.options.filterFn||function(n){return function(i){var f,e,o;return o=[[],{}],f=o[0],e=o[1],i.split(" ").forEach(function(n){var t;return n.indexOf(":")>=0?(t=n.split(":"),e[t[0]]=function(){switch(t[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return t[1].toLowerCase()}}()):f.push(n)}),f=f.join(" "),function(i){var s,o,h;return s=function(){var n=[];for(o in e)h=e[o],n.push(function(n){return function(t,r){var f;return(f=n.rowAttributeMap()[t.toLowerCase()])?u(ko.isObservable(i[f])?i[f]():i[f],r):!1}}(this)(o,h));return n}.call(n),t.call(s,!1)<0&&(f!==""?i.match!=null?i.match(f):r(f,i,n.rowAttributeMap()):!0)}}}(this)},r.prototype.initWithServerSidePagination=function(){var n,t;return t=function(n){return function(t,i){var u,r,f,e;return f=""+n.options.paginationPath+"?"+function(){var n=[];for(u in t)e=t[u],n.push(""+encodeURIComponent(u)+"="+encodeURIComponent(e));return n}().join("&"),r=new XMLHttpRequest,r.open("GET",f,!0),r.setRequestHeader("Content-Type","application/json"),r.onload=function(){return r.status>=200&&r.status<400?i(null,JSON.parse(r.responseText)):i(new Error("Error communicating with server"))},r.onerror=function(){return i(new Error("Error communicating with server"))},r.send()}}(this),n=function(n,t,i,r,u){var f;return f={perPage:n,page:t},i!=null&&i!==""&&(f.filter=i),r!=null&&r!==""&&u!=null&&u!==""&&(f.sortDir=r,f.sortBy=u),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(n){return function(){return n.currentPageNumber(1)}}(this)),ko.computed(function(i){return function(){var r;return i.loading(!0),i.filtering(!0),r=n(i.perPage(),i.currentPageNumber(),i.filter(),i.sortDir(),i.sortField()),t(r,function(n,t){var r,u;return(i.loading(!1),i.filtering(!1),n)?console.log(n):(u=t.total,r=t.results,i.numFilteredRows(u),i.pagedRows(r.map(i.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=i(function(n){return function(){return n.getPages(n.numFilteredRows())}}(this)),this.limitedPages=i(function(n){return function(){return n.getLimitedPages()}}(this)),this.currentPage=i(function(n){return function(){return n.pages()[n.currentPageNumber()-1]}}(this)),this.pagedRows=i(function(n){return function(){return n.filteredRows().slice(n.currentPage().start,n.currentPage().end+1)}}(this)),this.leftPagerClass=i(function(n){return function(){if(n.currentPageNumber()===1)return"disabled"}}(this)),this.rightPagerClass=i(function(n){return function(){if(n.currentPageNumber()===n.pages().length)return"disabled"}}(this)),this.from=i(function(n){return function(){return n.currentPage().start+1}}(this)),this.to=i(function(n){return function(){return n.currentPage().end+1}}(this)),this.recordsText=i(function(n){return function(){var u,i,r,f,t;return t=n.numFilteredRows(),u=n.from(),f=n.to(),i=n.options.recordWord,r=n.options.recordWordPlural||i+"s",n.pages().length>1?""+u+" to "+f+" of "+t+" "+r:""+t+" "+(t>1||t===0?r:i)}}(this)),this.showNoData=i(function(n){return function(){return n.pagedRows().length===0&&!n.loading()}}(this)),this.showLoading=i(function(n){return function(){return n.loading()}}(this)),this.sortClass=function(n){return function(t){return i(function(){return n.sortField()===t?"sorted "+(n.sortDir()==="asc"?n.options.ascSortClass:n.options.descSortClass):n.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled");},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled");},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled");},this.refreshData=function(i){return function(){var r;return i.loading(!0),i.filtering(!0),r=n(i.perPage(),i.currentPageNumber(),i.filter(),i.sortDir(),i.sortField()),t(r,function(n,t){var r,u;return(i.loading(!1),i.filtering(!1),n)?console.log(n):(u=t.total,r=t.results,i.numFilteredRows(u),i.pagedRows(r.map(i.options.resultHandlerFn)))})}}(this)},r.prototype.toggleSort=function(n){return function(t){return function(){return t.currentPageNumber(1),t.sortField()===n?t.sortDir(t.sortDir()==="asc"?"desc":"asc"):(t.sortDir("asc"),t.sortField(n))}}(this)},r.prototype.prevPage=function(){var n;return n=this.currentPageNumber(),n!==1?this.currentPageNumber(n-1):void 0},r.prototype.nextPage=function(){var n;return n=this.currentPageNumber(),n!==this.pages().length?this.currentPageNumber(n+1):void 0},r.prototype.gotoPage=function(n){return function(t){return function(){return t.currentPageNumber(n)}}(this)},r.prototype.pageClass=function(n){return i(function(t){return function(){if(t.currentPageNumber()===n)return"active"}}(this))},r}()}).call(this); -//# sourceMappingURL=knockout-datatable.min.js.map +(function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};this.DataTable=function(){function c(b,c){this.getLimitedPages=a(this.getLimitedPages,this),this.getPages=a(this.getPages,this);var d;if(c||(b instanceof Array?c={}:(c=b,b=[])),this.options={recordWord:c.recordWord||"record",recordWordPlural:c.recordWordPlural,sortDir:c.sortDir||"asc",sortField:c.sortField||void 0,perPage:c.perPage||15,paginationLimit:c.paginationLimit||10,filterFn:c.filterFn||void 0,unsortedClass:c.unsortedClass||"",descSortClass:c.descSortClass||"",ascSortClass:c.ascSortClass||""},this.initObservables(),(d=c.serverSidePagination)&&d.enabled){if(!d.path||!d.loader)throw new Error("`path` or `loader` missing from `serverSidePagination` object");this.options.paginationPath=d.path,this.options.resultHandlerFn=d.loader,this.initWithServerSidePagination()}else this.initWithClientSidePagination(b)}var d,e;return e=ko.pureComputed||ko.computed,d=function(a,b){return null==b?null==a:null!=a?"boolean"==typeof a?a===b:a.toString().toLowerCase().indexOf(b.toString().toLowerCase())>=0||a===b:!1},c.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable(""),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},c.prototype.getPages=function(a){var b,c,d,e,f;for(e=this.perPage(),f=0,c=1,d=new Array(Math.ceil(a/e));a>f;)b={number:c,start:f,end:Math.min(a-1,f+e-1)},b.blanks=new Array(d.length>1?e-(b.end-b.start+1):0),d[c-1]=b,c++,f+=e;return d},c.prototype.getLimitedPages=function(){var a,b,c,d,e,f,g;return f=this.pages(),a=this.currentPageNumber(),e=this.options.paginationLimit,f.length<=e?f:(d=Math.floor(e/2),b=a-Math.floor(d),1>b?f.slice(0,e):(g=e%2===0?d-1:d,c=a+g,c>f.length?f.slice(f.length-e,f.length):f.slice(b-1,c)))},c.prototype.initWithClientSidePagination=function(a){var c;return this.filtering=ko.observable(!1),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.rows(a),this.rowAttributeMap=e(function(b){return function(){var c,d,e;if(a=b.rows(),c={},a.length>0){e=a[0];for(d in e)e.hasOwnProperty(d)&&(c[d.toLowerCase()]=d)}return c}}(this)),this.filteredRows=e(function(b){return function(){var c,d;return b.filtering(!0),c=b.filter(),a=b.rows.slice(0),""!==c&&(d=b.filterFn(c),a=a.filter(d)),null!=b.sortField()&&""!==b.sortField()&&a.sort(function(a,c){var d,e;return d=ko.utils.unwrapObservable(a[b.sortField()]),e=ko.utils.unwrapObservable(c[b.sortField()]),"string"==typeof d&&(d=d.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),"asc"===b.sortDir()?e>d||""===d||null==d?-1:d>e||""===e||null==e?1:0:e>d||""===d||null==d?1:d>e||""===e||null==e?-1:0}),b.filtering(!1),a}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.filteredRows().length)}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages()[a.currentPageNumber()-1]}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.total=e(function(a){return function(){return a.filteredRows().length}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return b=a.from(),e=a.to(),f=a.total(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(a){return function(b){return a.rows.push(b)}}(this),this.removeRecord=function(a){return function(b){return a.rows.remove(b),0===a.pagedRows().length?a.prevPage():void 0}}(this),this.replaceRows=function(a){return function(b){return a.rows(b),a.currentPageNumber(1),a.filter(void 0)}}(this),c=function(a,b,c){var e,f;return function(){var a;a=[];for(e in c)f=c[e],a.push(f);return a}().some(function(c){return d(ko.isObservable(b[c])?b[c]():b[c],a)})},this.filterFn=this.options.filterFn||function(a){return function(e){var f,g,h;return h=[[],{}],f=h[0],g=h[1],e.split(" ").forEach(function(a){var b;return a.indexOf(":")>=0?(b=a.split(":"),g[b[0]]=function(){switch(b[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return b[1].toLowerCase()}}()):f.push(a)}),f=f.join(" "),function(e){var h,i,j;return h=function(){var a;a=[];for(i in g)j=g[i],a.push(function(a){return function(b,c){var f;return(f=a.rowAttributeMap()[b.toLowerCase()])?d(ko.isObservable(e[f])?e[f]():e[f],c):!1}}(this)(i,j));return a}.call(a),b.call(h,!1)<0&&(""!==f?null!=e.match?e.match(f):c(f,e,a.rowAttributeMap()):!0)}}}(this)},c.prototype.initWithServerSidePagination=function(){var a,b;return b=function(a){return function(b,c){var d,e,f,g;return f=""+a.options.paginationPath+"?"+function(){var a;a=[];for(d in b)g=b[d],a.push(""+encodeURIComponent(d)+"="+encodeURIComponent(g));return a}().join("&"),e=new XMLHttpRequest,e.open("GET",f,!0),e.setRequestHeader("Content-Type","application/json"),e.onload=function(){return e.status>=200&&e.status<400?c(null,JSON.parse(e.responseText)):c(new Error("Error communicating with server"))},e.onerror=function(){return c(new Error("Error communicating with server"))},e.send()}}(this),a=function(a,b,c,d,e){var f;return f={perPage:a,page:b},null!=c&&""!==c&&(f.filter=c),null!=d&&""!==d&&null!=e&&""!==e&&(f.sortDir=d,f.sortBy=e),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),ko.computed(function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.numFilteredRows())}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages()[a.currentPageNumber()-1]}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return f=a.numFilteredRows(),b=a.from(),e=a.to(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled")},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled")},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled")},this.refreshData=function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)},c.prototype.toggleSort=function(a){return function(b){return function(){return b.currentPageNumber(1),b.sortField()===a?b.sortDir("asc"===b.sortDir()?"desc":"asc"):(b.sortDir("asc"),b.sortField(a))}}(this)},c.prototype.prevPage=function(){var a;return a=this.currentPageNumber(),1!==a?this.currentPageNumber(a-1):void 0},c.prototype.nextPage=function(){var a;return a=this.currentPageNumber(),a!==this.pages().length?this.currentPageNumber(a+1):void 0},c.prototype.gotoPage=function(a){return function(b){return function(){return b.currentPageNumber(a)}}(this)},c.prototype.pageClass=function(a){return e(function(b){return function(){return b.currentPageNumber()===a?"active":void 0}}(this))},c}()}).call(this); +//# sourceMappingURL=knockout-datatable.min.js.map \ No newline at end of file diff --git a/knockout-datatable.min.js.map b/knockout-datatable.min.js.map index b713aa1..f981e59 100644 --- a/knockout-datatable.min.js.map +++ b/knockout-datatable.min.js.map @@ -1,8 +1 @@ -{ -"version":3, -"file":"knockout-datatable.min.js", -"lineCount":1, -"mappings":"CAACA,QAAQ,CAAA,CAAG,CACV,IAAIC,EAAS,QAAQ,CAACC,CAAE,CAAEC,CAAL,CAAQ,CAAE,OAAO,QAAQ,CAAA,CAAE,CAAE,OAAOD,CAAEE,MAAM,CAACD,CAAE,CAAEE,SAAL,CAAjB,CAAnB,EAC3BC,EAAY,CAAA,CAAEC,QAAS,EAAG,QAAQ,CAACC,CAAD,CAAO,CAAE,IAAK,IAAIC,EAAI,EAAGC,EAAI,IAAIC,OAAO,CAAEF,CAAE,CAAEC,CAAC,CAAED,CAAC,EAAzC,CAA+C,GAAIA,EAAE,GAAG,IAAK,EAAG,IAAK,CAAAA,CAAA,CAAG,GAAID,EAAM,OAAOC,CAAG,CAAE,MAAO,EAAvG,CAA4G,CAEvJ,IAAIG,UAAW,CAAG,QAAQ,CAAA,CAAG,CAmB3BA,SAASA,CAAS,CAACC,CAAI,CAAEC,CAAP,CAAgB,CAChC,IAAI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AU,CAAEC,QAAQ,CAAA,CAAG,CACxC,IAAIhH,CAAI,CAER,OADAA,CAAK,CAAE,IAAIN,kBAAkB,CAAA,CAAE,CAC3BM,CAAK,GAAI,IAAIgB,MAAM,CAAA,CAAE7D,OAArB,CACK,IAAIuC,kBAAkB,CAACM,CAAK,CAAE,CAAR,CAD3B,CACF,KAAA,CAJsC,CAMzC,CAED5C,CAASmC,UAAU0H,SAAU,CAAEC,QAAQ,CAAClH,CAAD,CAAO,CAC5C,OAAQ,QAAQ,CAACwB,CAAD,CAAQ,CACtB,OAAO,QAAQ,CAAA,CAAG,CAChB,OAAOA,CAAK9B,kBAAkB,CAACM,CAAD,CADd,CADI,CAItB,CAAC,IAAD,CAL0C,CAM7C,CAED5C,CAASmC,UAAU4H,UAAW,CAAEC,QAAQ,CAACpH,CAAD,CAAO,CAC7C,OAAOhB,CAAY,CAAE,QAAQ,CAACwC,CAAD,CAAQ,CACnC,OAAO,QAAQ,CAAA,CAAG,CAChB,GAAIA,CAAK9B,kBAAkB,CAAA,CAAG,GAAIM,EAAlC,MACS,QAFO,CADiB,CAMnC,CAAC,IAAD,CANiB,CAD0B,CAQ9C,CAEM5C,CA3lBoB,CA6lB3B,CAAA,CAjmBQ,EAmmBVqH,KAAK,CAAC,IAAD,CAAM", -"sources":["knockout-datatable.js"], -"names":[".call","__bind","fn","me","apply","arguments","__indexOf","indexOf","item","i","l","length","DataTable","rows","options","getLimitedPages","getPages","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","DataTable.prototype.initObservables","observable","currentPageNumber","filter","loading","observableArray","DataTable.prototype.getPages","rowCount","page","pageNumber","pagesArr","rowIndex","Math","ceil","min","blanks","end","start","DataTable.prototype.getLimitedPages","current","firstPage","lastPage","leftMargin","limit","pages","rightMargin","floor","slice","DataTable.prototype.initWithClientSidePagination","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","extend","limitedPages","currentPage","pagedRows","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","DataTable.prototype.initWithServerSidePagination","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","req.onload","status","JSON","parse","responseText","onerror","req.onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map",".addRecord",".removeRecord",".replaceRows","refreshData","toggleSort","DataTable.prototype.toggleSort","field","DataTable.prototype.prevPage","nextPage","DataTable.prototype.nextPage","gotoPage","DataTable.prototype.gotoPage","pageClass","DataTable.prototype.pageClass"] -} +{"version":3,"file":"knockout-datatable.min.js","sources":["knockout-datatable.js"],"names":["__bind","fn","me","apply","arguments","__indexOf","indexOf","item","i","l","this","length","DataTable","rows","options","getLimitedPages","getPages","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","observable","currentPageNumber","filter","loading","observableArray","rowCount","page","pageNumber","pagesArr","rowIndex","Math","ceil","number","start","end","min","blanks","current","firstPage","lastPage","leftMargin","limit","pages","rightMargin","floor","slice","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","extend","rateLimit","method","limitedPages","currentPage","pagedRows","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","status","JSON","parse","responseText","onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map","refreshData","toggleSort","field","nextPage","gotoPage","pageClass"],"mappings":"CAAA,WACE,GAAIA,GAAS,SAASC,EAAIC,GAAK,MAAO,YAAY,MAAOD,GAAGE,MAAMD,EAAIE,aACpEC,KAAeC,SAAW,SAASC,GAAQ,IAAK,GAAIC,GAAI,EAAGC,EAAIC,KAAKC,OAAYF,EAAJD,EAAOA,IAAO,GAAIA,IAAKE,OAAQA,KAAKF,KAAOD,EAAM,MAAOC,EAAK,OAAO,GAElJE,MAAKE,UAAY,WAmBf,QAASA,GAAUC,EAAMC,GACvBJ,KAAKK,gBAAkBf,EAAOU,KAAKK,gBAAiBL,MACpDA,KAAKM,SAAWhB,EAAOU,KAAKM,SAAUN,KACtC,IAAIO,EAsBJ,IArBKH,IACGD,YAAgBK,OAIpBJ,MAHAA,EAAUD,EACVA,OAKJH,KAAKI,SACHK,WAAYL,EAAQK,YAAc,SAClCC,iBAAkBN,EAAQM,iBAC1BC,QAASP,EAAQO,SAAW,MAC5BC,UAAWR,EAAQQ,WAAa,OAChCC,QAAST,EAAQS,SAAW,GAC5BC,gBAAiBV,EAAQU,iBAAmB,GAC5CC,SAAUX,EAAQW,UAAY,OAC9BC,cAAeZ,EAAQY,eAAiB,GACxCC,cAAeb,EAAQa,eAAiB,GACxCC,aAAcd,EAAQc,cAAgB,IAExClB,KAAKmB,mBACAZ,EAAiBH,EAAQgB,uBAAyBb,EAAec,QAAS,CAC7E,IAAMd,EAAee,OAAQf,EAAegB,OAC1C,KAAM,IAAIC,OAAM,gEAElBxB,MAAKI,QAAQqB,eAAiBlB,EAAee,K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QAKF1C,EAAUmC,UAAUgH,SAAW,SAASzG,GACtC,MAAO,UAAUuB,GACf,MAAO,YACL,MAAOA,GAAM5B,kBAAkBK,KAEhC5C,OAGLE,EAAUmC,UAAUiH,UAAY,SAAS1G,GACvC,MAAOd,GAAa,SAAUqC,GAC5B,MAAO,YACL,MAAIA,GAAM5B,sBAAwBK,EACzB,SADT,SAID5C,QAGEE,OAIRoH,KAAKtH"} \ No newline at end of file From 54d32a64effea619eaeef62a00b71e34d6d7e773 Mon Sep 17 00:00:00 2001 From: Ohad Schneider Date: Sat, 14 Mar 2015 00:33:11 +0200 Subject: [PATCH 4/8] Fixed currentPage bug when there are no rows --- knockout-datatable.coffee | 2 +- knockout-datatable.js | 11 ++++++++++- knockout-datatable.min.js | 2 +- knockout-datatable.min.js.map | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/knockout-datatable.coffee b/knockout-datatable.coffee index 3f28ee5..5290576 100644 --- a/knockout-datatable.coffee +++ b/knockout-datatable.coffee @@ -145,7 +145,7 @@ class @DataTable @pages = pureComputed => @getPages @filteredRows().length @limitedPages = pureComputed => @getLimitedPages() - @currentPage = pureComputed => @pages()[@currentPageNumber() - 1] + @currentPage = pureComputed => if @pages().length > 0 then @pages()[@currentPageNumber() - 1] else {number: 1, start:0, end: 0, blanks: []} @pagedRows = pureComputed => @filteredRows().slice(@currentPage().start, @currentPage().end + 1) @leftPagerClass = pureComputed => 'disabled' if @currentPageNumber() is 1 diff --git a/knockout-datatable.js b/knockout-datatable.js index 5e48ad3..5b4a2d4 100644 --- a/knockout-datatable.js +++ b/knockout-datatable.js @@ -204,7 +204,16 @@ })(this)); this.currentPage = pureComputed((function(_this) { return function() { - return _this.pages()[_this.currentPageNumber() - 1]; + if (_this.pages().length > 0) { + return _this.pages()[_this.currentPageNumber() - 1]; + } else { + return { + number: 1, + start: 0, + end: 0, + blanks: [] + }; + } }; })(this)); this.pagedRows = pureComputed((function(_this) { diff --git a/knockout-datatable.min.js b/knockout-datatable.min.js index 5708a78..60206f5 100644 --- a/knockout-datatable.min.js +++ b/knockout-datatable.min.js @@ -1,2 +1,2 @@ -(function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};this.DataTable=function(){function c(b,c){this.getLimitedPages=a(this.getLimitedPages,this),this.getPages=a(this.getPages,this);var d;if(c||(b instanceof Array?c={}:(c=b,b=[])),this.options={recordWord:c.recordWord||"record",recordWordPlural:c.recordWordPlural,sortDir:c.sortDir||"asc",sortField:c.sortField||void 0,perPage:c.perPage||15,paginationLimit:c.paginationLimit||10,filterFn:c.filterFn||void 0,unsortedClass:c.unsortedClass||"",descSortClass:c.descSortClass||"",ascSortClass:c.ascSortClass||""},this.initObservables(),(d=c.serverSidePagination)&&d.enabled){if(!d.path||!d.loader)throw new Error("`path` or `loader` missing from `serverSidePagination` object");this.options.paginationPath=d.path,this.options.resultHandlerFn=d.loader,this.initWithServerSidePagination()}else this.initWithClientSidePagination(b)}var d,e;return e=ko.pureComputed||ko.computed,d=function(a,b){return null==b?null==a:null!=a?"boolean"==typeof a?a===b:a.toString().toLowerCase().indexOf(b.toString().toLowerCase())>=0||a===b:!1},c.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable(""),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},c.prototype.getPages=function(a){var b,c,d,e,f;for(e=this.perPage(),f=0,c=1,d=new Array(Math.ceil(a/e));a>f;)b={number:c,start:f,end:Math.min(a-1,f+e-1)},b.blanks=new Array(d.length>1?e-(b.end-b.start+1):0),d[c-1]=b,c++,f+=e;return d},c.prototype.getLimitedPages=function(){var a,b,c,d,e,f,g;return f=this.pages(),a=this.currentPageNumber(),e=this.options.paginationLimit,f.length<=e?f:(d=Math.floor(e/2),b=a-Math.floor(d),1>b?f.slice(0,e):(g=e%2===0?d-1:d,c=a+g,c>f.length?f.slice(f.length-e,f.length):f.slice(b-1,c)))},c.prototype.initWithClientSidePagination=function(a){var c;return this.filtering=ko.observable(!1),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.rows(a),this.rowAttributeMap=e(function(b){return function(){var c,d,e;if(a=b.rows(),c={},a.length>0){e=a[0];for(d in e)e.hasOwnProperty(d)&&(c[d.toLowerCase()]=d)}return c}}(this)),this.filteredRows=e(function(b){return function(){var c,d;return b.filtering(!0),c=b.filter(),a=b.rows.slice(0),""!==c&&(d=b.filterFn(c),a=a.filter(d)),null!=b.sortField()&&""!==b.sortField()&&a.sort(function(a,c){var d,e;return d=ko.utils.unwrapObservable(a[b.sortField()]),e=ko.utils.unwrapObservable(c[b.sortField()]),"string"==typeof d&&(d=d.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),"asc"===b.sortDir()?e>d||""===d||null==d?-1:d>e||""===e||null==e?1:0:e>d||""===d||null==d?1:d>e||""===e||null==e?-1:0}),b.filtering(!1),a}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.filteredRows().length)}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages()[a.currentPageNumber()-1]}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.total=e(function(a){return function(){return a.filteredRows().length}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return b=a.from(),e=a.to(),f=a.total(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(a){return function(b){return a.rows.push(b)}}(this),this.removeRecord=function(a){return function(b){return a.rows.remove(b),0===a.pagedRows().length?a.prevPage():void 0}}(this),this.replaceRows=function(a){return function(b){return a.rows(b),a.currentPageNumber(1),a.filter(void 0)}}(this),c=function(a,b,c){var e,f;return function(){var a;a=[];for(e in c)f=c[e],a.push(f);return a}().some(function(c){return d(ko.isObservable(b[c])?b[c]():b[c],a)})},this.filterFn=this.options.filterFn||function(a){return function(e){var f,g,h;return h=[[],{}],f=h[0],g=h[1],e.split(" ").forEach(function(a){var b;return a.indexOf(":")>=0?(b=a.split(":"),g[b[0]]=function(){switch(b[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return b[1].toLowerCase()}}()):f.push(a)}),f=f.join(" "),function(e){var h,i,j;return h=function(){var a;a=[];for(i in g)j=g[i],a.push(function(a){return function(b,c){var f;return(f=a.rowAttributeMap()[b.toLowerCase()])?d(ko.isObservable(e[f])?e[f]():e[f],c):!1}}(this)(i,j));return a}.call(a),b.call(h,!1)<0&&(""!==f?null!=e.match?e.match(f):c(f,e,a.rowAttributeMap()):!0)}}}(this)},c.prototype.initWithServerSidePagination=function(){var a,b;return b=function(a){return function(b,c){var d,e,f,g;return f=""+a.options.paginationPath+"?"+function(){var a;a=[];for(d in b)g=b[d],a.push(""+encodeURIComponent(d)+"="+encodeURIComponent(g));return a}().join("&"),e=new XMLHttpRequest,e.open("GET",f,!0),e.setRequestHeader("Content-Type","application/json"),e.onload=function(){return e.status>=200&&e.status<400?c(null,JSON.parse(e.responseText)):c(new Error("Error communicating with server"))},e.onerror=function(){return c(new Error("Error communicating with server"))},e.send()}}(this),a=function(a,b,c,d,e){var f;return f={perPage:a,page:b},null!=c&&""!==c&&(f.filter=c),null!=d&&""!==d&&null!=e&&""!==e&&(f.sortDir=d,f.sortBy=e),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),ko.computed(function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.numFilteredRows())}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages()[a.currentPageNumber()-1]}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return f=a.numFilteredRows(),b=a.from(),e=a.to(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled")},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled")},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled")},this.refreshData=function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)},c.prototype.toggleSort=function(a){return function(b){return function(){return b.currentPageNumber(1),b.sortField()===a?b.sortDir("asc"===b.sortDir()?"desc":"asc"):(b.sortDir("asc"),b.sortField(a))}}(this)},c.prototype.prevPage=function(){var a;return a=this.currentPageNumber(),1!==a?this.currentPageNumber(a-1):void 0},c.prototype.nextPage=function(){var a;return a=this.currentPageNumber(),a!==this.pages().length?this.currentPageNumber(a+1):void 0},c.prototype.gotoPage=function(a){return function(b){return function(){return b.currentPageNumber(a)}}(this)},c.prototype.pageClass=function(a){return e(function(b){return function(){return b.currentPageNumber()===a?"active":void 0}}(this))},c}()}).call(this); +(function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};this.DataTable=function(){function c(b,c){this.getLimitedPages=a(this.getLimitedPages,this),this.getPages=a(this.getPages,this);var d;if(c||(b instanceof Array?c={}:(c=b,b=[])),this.options={recordWord:c.recordWord||"record",recordWordPlural:c.recordWordPlural,sortDir:c.sortDir||"asc",sortField:c.sortField||void 0,perPage:c.perPage||15,paginationLimit:c.paginationLimit||10,filterFn:c.filterFn||void 0,unsortedClass:c.unsortedClass||"",descSortClass:c.descSortClass||"",ascSortClass:c.ascSortClass||""},this.initObservables(),(d=c.serverSidePagination)&&d.enabled){if(!d.path||!d.loader)throw new Error("`path` or `loader` missing from `serverSidePagination` object");this.options.paginationPath=d.path,this.options.resultHandlerFn=d.loader,this.initWithServerSidePagination()}else this.initWithClientSidePagination(b)}var d,e;return e=ko.pureComputed||ko.computed,d=function(a,b){return null==b?null==a:null!=a?"boolean"==typeof a?a===b:a.toString().toLowerCase().indexOf(b.toString().toLowerCase())>=0||a===b:!1},c.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable(""),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},c.prototype.getPages=function(a){var b,c,d,e,f;for(e=this.perPage(),f=0,c=1,d=new Array(Math.ceil(a/e));a>f;)b={number:c,start:f,end:Math.min(a-1,f+e-1)},b.blanks=new Array(d.length>1?e-(b.end-b.start+1):0),d[c-1]=b,c++,f+=e;return d},c.prototype.getLimitedPages=function(){var a,b,c,d,e,f,g;return f=this.pages(),a=this.currentPageNumber(),e=this.options.paginationLimit,f.length<=e?f:(d=Math.floor(e/2),b=a-Math.floor(d),1>b?f.slice(0,e):(g=e%2===0?d-1:d,c=a+g,c>f.length?f.slice(f.length-e,f.length):f.slice(b-1,c)))},c.prototype.initWithClientSidePagination=function(a){var c;return this.filtering=ko.observable(!1),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.rows(a),this.rowAttributeMap=e(function(b){return function(){var c,d,e;if(a=b.rows(),c={},a.length>0){e=a[0];for(d in e)e.hasOwnProperty(d)&&(c[d.toLowerCase()]=d)}return c}}(this)),this.filteredRows=e(function(b){return function(){var c,d;return b.filtering(!0),c=b.filter(),a=b.rows.slice(0),""!==c&&(d=b.filterFn(c),a=a.filter(d)),null!=b.sortField()&&""!==b.sortField()&&a.sort(function(a,c){var d,e;return d=ko.utils.unwrapObservable(a[b.sortField()]),e=ko.utils.unwrapObservable(c[b.sortField()]),"string"==typeof d&&(d=d.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),"asc"===b.sortDir()?e>d||""===d||null==d?-1:d>e||""===e||null==e?1:0:e>d||""===d||null==d?1:d>e||""===e||null==e?-1:0}),b.filtering(!1),a}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.filteredRows().length)}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages().length>0?a.pages()[a.currentPageNumber()-1]:{number:1,start:0,end:0,blanks:[]}}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.total=e(function(a){return function(){return a.filteredRows().length}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return b=a.from(),e=a.to(),f=a.total(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(a){return function(b){return a.rows.push(b)}}(this),this.removeRecord=function(a){return function(b){return a.rows.remove(b),0===a.pagedRows().length?a.prevPage():void 0}}(this),this.replaceRows=function(a){return function(b){return a.rows(b),a.currentPageNumber(1),a.filter(void 0)}}(this),c=function(a,b,c){var e,f;return function(){var a;a=[];for(e in c)f=c[e],a.push(f);return a}().some(function(c){return d(ko.isObservable(b[c])?b[c]():b[c],a)})},this.filterFn=this.options.filterFn||function(a){return function(e){var f,g,h;return h=[[],{}],f=h[0],g=h[1],e.split(" ").forEach(function(a){var b;return a.indexOf(":")>=0?(b=a.split(":"),g[b[0]]=function(){switch(b[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return b[1].toLowerCase()}}()):f.push(a)}),f=f.join(" "),function(e){var h,i,j;return h=function(){var a;a=[];for(i in g)j=g[i],a.push(function(a){return function(b,c){var f;return(f=a.rowAttributeMap()[b.toLowerCase()])?d(ko.isObservable(e[f])?e[f]():e[f],c):!1}}(this)(i,j));return a}.call(a),b.call(h,!1)<0&&(""!==f?null!=e.match?e.match(f):c(f,e,a.rowAttributeMap()):!0)}}}(this)},c.prototype.initWithServerSidePagination=function(){var a,b;return b=function(a){return function(b,c){var d,e,f,g;return f=""+a.options.paginationPath+"?"+function(){var a;a=[];for(d in b)g=b[d],a.push(""+encodeURIComponent(d)+"="+encodeURIComponent(g));return a}().join("&"),e=new XMLHttpRequest,e.open("GET",f,!0),e.setRequestHeader("Content-Type","application/json"),e.onload=function(){return e.status>=200&&e.status<400?c(null,JSON.parse(e.responseText)):c(new Error("Error communicating with server"))},e.onerror=function(){return c(new Error("Error communicating with server"))},e.send()}}(this),a=function(a,b,c,d,e){var f;return f={perPage:a,page:b},null!=c&&""!==c&&(f.filter=c),null!=d&&""!==d&&null!=e&&""!==e&&(f.sortDir=d,f.sortBy=e),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),ko.computed(function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.numFilteredRows())}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages()[a.currentPageNumber()-1]}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return f=a.numFilteredRows(),b=a.from(),e=a.to(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled")},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled")},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled")},this.refreshData=function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)},c.prototype.toggleSort=function(a){return function(b){return function(){return b.currentPageNumber(1),b.sortField()===a?b.sortDir("asc"===b.sortDir()?"desc":"asc"):(b.sortDir("asc"),b.sortField(a))}}(this)},c.prototype.prevPage=function(){var a;return a=this.currentPageNumber(),1!==a?this.currentPageNumber(a-1):void 0},c.prototype.nextPage=function(){var a;return a=this.currentPageNumber(),a!==this.pages().length?this.currentPageNumber(a+1):void 0},c.prototype.gotoPage=function(a){return function(b){return function(){return b.currentPageNumber(a)}}(this)},c.prototype.pageClass=function(a){return e(function(b){return function(){return b.currentPageNumber()===a?"active":void 0}}(this))},c}()}).call(this); //# sourceMappingURL=knockout-datatable.min.js.map \ No newline at end of file diff --git a/knockout-datatable.min.js.map b/knockout-datatable.min.js.map index f981e59..8fd0216 100644 --- a/knockout-datatable.min.js.map +++ b/knockout-datatable.min.js.map @@ -1 +1 @@ -{"version":3,"file":"knockout-datatable.min.js","sources":["knockout-datatable.js"],"names":["__bind","fn","me","apply","arguments","__indexOf","indexOf","item","i","l","this","length","DataTable","rows","options","getLimitedPages","getPages","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","observable","currentPageNumber","filter","loading","observableArray","rowCount","page","pageNumber","pagesArr","rowIndex","Math","ceil","number","start","end","min","blanks","current","firstPage","lastPage","leftMargin","limit","pages","rightMargin","floor","slice","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","extend","rateLimit","method","limitedPages","currentPage","pagedRows","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","status","JSON","parse","responseText","onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map","refreshData","toggleSort","field","nextPage","gotoPage","pageClass"],"mappings":"CAAA,WACE,GAAIA,GAAS,SAASC,EAAIC,GAAK,MAAO,YAAY,MAAOD,GAAGE,MAAMD,EAAIE,aACpEC,KAAeC,SAAW,SAASC,GAAQ,IAAK,GAAIC,GAAI,EAAGC,EAAIC,KAAKC,OAAYF,EAAJD,EAAOA,IAAO,GAAIA,IAAKE,OAAQA,KAAKF,KAAOD,EAAM,MAAOC,EAAK,OAAO,GAElJE,MAAKE,UAAY,WAmBf,QAASA,GAAUC,EAAMC,GACvBJ,KAAKK,gBAAkBf,EAAOU,KAAKK,gBAAiBL,MACpDA,KAAKM,SAAWhB,EAAOU,KAAKM,SAAUN,KACtC,IAAIO,EAsBJ,IArBKH,IACGD,YAAgBK,OAIpBJ,MAHAA,EAAUD,EACVA,OAKJH,KAAKI,SACHK,WAAYL,EAAQK,YAAc,SAClCC,iBAAkBN,EAAQM,iBAC1BC,QAASP,EAAQO,SAAW,MAC5BC,UAAWR,EAAQQ,WAAa,OAChCC,QAAST,EAAQS,SAAW,GAC5BC,gBAAiBV,EAAQU,iBAAmB,GAC5CC,SAAUX,EAAQW,UAAY,OAC9BC,cAAeZ,EAAQY,eAAiB,GACxCC,cAAeb,EAAQa,eAAiB,GACxCC,aAAcd,EAAQc,cAAgB,IAExClB,KAAKmB,mBACAZ,EAAiBH,EAAQgB,uBAAyBb,EAA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B,GAAIxG,EAEJ,OADAA,GAAO5C,KAAKuC,oBACRK,IAAS5C,KAAK4D,QAAQ3D,OACjBD,KAAKuC,kBAAkBK,EAAO,GADvC,QAKF1C,EAAUmC,UAAUgH,SAAW,SAASzG,GACtC,MAAO,UAAUuB,GACf,MAAO,YACL,MAAOA,GAAM5B,kBAAkBK,KAEhC5C,OAGLE,EAAUmC,UAAUiH,UAAY,SAAS1G,GACvC,MAAOd,GAAa,SAAUqC,GAC5B,MAAO,YACL,MAAIA,GAAM5B,sBAAwBK,EACzB,SADT,SAID5C,QAGEE,OAIRoH,KAAKtH"} \ No newline at end of file +{"version":3,"file":"knockout-datatable.min.js","sources":["knockout-datatable.js"],"names":["__bind","fn","me","apply","arguments","__indexOf","indexOf","item","i","l","this","length","DataTable","rows","options","getLimitedPages","getPages","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","observable","currentPageNumber","filter","loading","observableArray","rowCount","page","pageNumber","pagesArr","rowIndex","Math","ceil","number","start","end","min","blanks","current","firstPage","lastPage","leftMargin","limit","pages","rightMargin","floor","slice","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","extend","rateLimit","method","limitedPages","currentPage","pagedRows","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","status","JSON","parse","responseText","onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map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B,MAAO,YACL,MAAIA,GAAM5B,sBAAwBK,EACzB,SADT,SAID5C,QAGEE,OAIRoH,KAAKtH"} \ No newline at end of file From 95c6543eb830ecfe7024d6371c3af2cc38e449ac Mon Sep 17 00:00:00 2001 From: Ohad Schneider Date: Fri, 22 May 2015 22:20:01 +0300 Subject: [PATCH 5/8] Added option to always match filter, even if it's blank (in cases where the filter may depend on other factors other than the filter observable) --- knockout-datatable.coffee | 5 +++-- knockout-datatable.js | 5 +++-- knockout-datatable.min.js | 2 +- knockout-datatable.min.js.map | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/knockout-datatable.coffee b/knockout-datatable.coffee index 5290576..0daf87f 100644 --- a/knockout-datatable.coffee +++ b/knockout-datatable.coffee @@ -31,6 +31,7 @@ class @DataTable perPage: options.perPage or 15 paginationLimit: options.paginationLimit or 10 filterFn: options.filterFn or undefined + alwaysMatch: options.alwaysMatch or false unsortedClass: options.unsortedClass or '' descSortClass: options.descSortClass or '' ascSortClass: options.ascSortClass or '' @@ -120,7 +121,7 @@ class @DataTable rows = @rows.slice(0) - if filter isnt '' + if @options.alwaysMatch or filter isnt '' filterFn = @filterFn(filter) rows = rows.filter(filterFn) @@ -220,7 +221,7 @@ class @DataTable primitiveCompare((if ko.isObservable(row[rowAttr]) then row[rowAttr]() else row[rowAttr]), val) else # if the current instance doesn't have the "key" attribute, return false (i.e., it's not a match) false - (false not in conditionals) and (if filter isnt '' then (if row.match? then row.match(filter) else _defaultMatch(filter, row, @rowAttributeMap())) else true) + (false not in conditionals) and (if (@options.alwaysMatch or filter isnt '') then (if row.match? then row.match(filter) else _defaultMatch(filter, row, @rowAttributeMap())) else true) initWithServerSidePagination: -> _getDataFromServer = (data, cb) => diff --git a/knockout-datatable.js b/knockout-datatable.js index 5b4a2d4..0004c55 100644 --- a/knockout-datatable.js +++ b/knockout-datatable.js @@ -41,6 +41,7 @@ perPage: options.perPage || 15, paginationLimit: options.paginationLimit || 10, filterFn: options.filterFn || void 0, + alwaysMatch: options.alwaysMatch || false, unsortedClass: options.unsortedClass || '', descSortClass: options.descSortClass || '', ascSortClass: options.ascSortClass || '' @@ -145,7 +146,7 @@ _this.filtering(true); filter = _this.filter(); rows = _this.rows.slice(0); - if (filter !== '') { + if (_this.options.alwaysMatch || filter !== '') { filterFn = _this.filterFn(filter); rows = rows.filter(filterFn); } @@ -370,7 +371,7 @@ } return _results; }).call(_this); - return (__indexOf.call(conditionals, false) < 0) && (filter !== '' ? (row.match != null ? row.match(filter) : _defaultMatch(filter, row, _this.rowAttributeMap())) : true); + return (__indexOf.call(conditionals, false) < 0) && (_this.options.alwaysMatch || filter !== '' ? (row.match != null ? row.match(filter) : _defaultMatch(filter, row, _this.rowAttributeMap())) : true); }; }; })(this); diff --git a/knockout-datatable.min.js b/knockout-datatable.min.js index 60206f5..fc5397c 100644 --- a/knockout-datatable.min.js +++ b/knockout-datatable.min.js @@ -1,2 +1,2 @@ -(function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};this.DataTable=function(){function c(b,c){this.getLimitedPages=a(this.getLimitedPages,this),this.getPages=a(this.getPages,this);var d;if(c||(b instanceof Array?c={}:(c=b,b=[])),this.options={recordWord:c.recordWord||"record",recordWordPlural:c.recordWordPlural,sortDir:c.sortDir||"asc",sortField:c.sortField||void 0,perPage:c.perPage||15,paginationLimit:c.paginationLimit||10,filterFn:c.filterFn||void 0,unsortedClass:c.unsortedClass||"",descSortClass:c.descSortClass||"",ascSortClass:c.ascSortClass||""},this.initObservables(),(d=c.serverSidePagination)&&d.enabled){if(!d.path||!d.loader)throw new Error("`path` or `loader` missing from `serverSidePagination` object");this.options.paginationPath=d.path,this.options.resultHandlerFn=d.loader,this.initWithServerSidePagination()}else this.initWithClientSidePagination(b)}var d,e;return e=ko.pureComputed||ko.computed,d=function(a,b){return null==b?null==a:null!=a?"boolean"==typeof a?a===b:a.toString().toLowerCase().indexOf(b.toString().toLowerCase())>=0||a===b:!1},c.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable(""),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},c.prototype.getPages=function(a){var b,c,d,e,f;for(e=this.perPage(),f=0,c=1,d=new Array(Math.ceil(a/e));a>f;)b={number:c,start:f,end:Math.min(a-1,f+e-1)},b.blanks=new Array(d.length>1?e-(b.end-b.start+1):0),d[c-1]=b,c++,f+=e;return d},c.prototype.getLimitedPages=function(){var a,b,c,d,e,f,g;return f=this.pages(),a=this.currentPageNumber(),e=this.options.paginationLimit,f.length<=e?f:(d=Math.floor(e/2),b=a-Math.floor(d),1>b?f.slice(0,e):(g=e%2===0?d-1:d,c=a+g,c>f.length?f.slice(f.length-e,f.length):f.slice(b-1,c)))},c.prototype.initWithClientSidePagination=function(a){var c;return this.filtering=ko.observable(!1),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.rows(a),this.rowAttributeMap=e(function(b){return function(){var c,d,e;if(a=b.rows(),c={},a.length>0){e=a[0];for(d in e)e.hasOwnProperty(d)&&(c[d.toLowerCase()]=d)}return c}}(this)),this.filteredRows=e(function(b){return function(){var c,d;return b.filtering(!0),c=b.filter(),a=b.rows.slice(0),""!==c&&(d=b.filterFn(c),a=a.filter(d)),null!=b.sortField()&&""!==b.sortField()&&a.sort(function(a,c){var d,e;return d=ko.utils.unwrapObservable(a[b.sortField()]),e=ko.utils.unwrapObservable(c[b.sortField()]),"string"==typeof d&&(d=d.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),"asc"===b.sortDir()?e>d||""===d||null==d?-1:d>e||""===e||null==e?1:0:e>d||""===d||null==d?1:d>e||""===e||null==e?-1:0}),b.filtering(!1),a}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.filteredRows().length)}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages().length>0?a.pages()[a.currentPageNumber()-1]:{number:1,start:0,end:0,blanks:[]}}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.total=e(function(a){return function(){return a.filteredRows().length}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return b=a.from(),e=a.to(),f=a.total(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(a){return function(b){return a.rows.push(b)}}(this),this.removeRecord=function(a){return function(b){return a.rows.remove(b),0===a.pagedRows().length?a.prevPage():void 0}}(this),this.replaceRows=function(a){return function(b){return a.rows(b),a.currentPageNumber(1),a.filter(void 0)}}(this),c=function(a,b,c){var e,f;return function(){var a;a=[];for(e in c)f=c[e],a.push(f);return a}().some(function(c){return d(ko.isObservable(b[c])?b[c]():b[c],a)})},this.filterFn=this.options.filterFn||function(a){return function(e){var f,g,h;return h=[[],{}],f=h[0],g=h[1],e.split(" ").forEach(function(a){var b;return a.indexOf(":")>=0?(b=a.split(":"),g[b[0]]=function(){switch(b[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return b[1].toLowerCase()}}()):f.push(a)}),f=f.join(" "),function(e){var h,i,j;return h=function(){var a;a=[];for(i in g)j=g[i],a.push(function(a){return function(b,c){var f;return(f=a.rowAttributeMap()[b.toLowerCase()])?d(ko.isObservable(e[f])?e[f]():e[f],c):!1}}(this)(i,j));return a}.call(a),b.call(h,!1)<0&&(""!==f?null!=e.match?e.match(f):c(f,e,a.rowAttributeMap()):!0)}}}(this)},c.prototype.initWithServerSidePagination=function(){var a,b;return b=function(a){return function(b,c){var d,e,f,g;return f=""+a.options.paginationPath+"?"+function(){var a;a=[];for(d in b)g=b[d],a.push(""+encodeURIComponent(d)+"="+encodeURIComponent(g));return a}().join("&"),e=new XMLHttpRequest,e.open("GET",f,!0),e.setRequestHeader("Content-Type","application/json"),e.onload=function(){return e.status>=200&&e.status<400?c(null,JSON.parse(e.responseText)):c(new Error("Error communicating with server"))},e.onerror=function(){return c(new Error("Error communicating with server"))},e.send()}}(this),a=function(a,b,c,d,e){var f;return f={perPage:a,page:b},null!=c&&""!==c&&(f.filter=c),null!=d&&""!==d&&null!=e&&""!==e&&(f.sortDir=d,f.sortBy=e),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),ko.computed(function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.numFilteredRows())}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages()[a.currentPageNumber()-1]}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return f=a.numFilteredRows(),b=a.from(),e=a.to(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled")},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled")},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled")},this.refreshData=function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)},c.prototype.toggleSort=function(a){return function(b){return function(){return b.currentPageNumber(1),b.sortField()===a?b.sortDir("asc"===b.sortDir()?"desc":"asc"):(b.sortDir("asc"),b.sortField(a))}}(this)},c.prototype.prevPage=function(){var a;return a=this.currentPageNumber(),1!==a?this.currentPageNumber(a-1):void 0},c.prototype.nextPage=function(){var a;return a=this.currentPageNumber(),a!==this.pages().length?this.currentPageNumber(a+1):void 0},c.prototype.gotoPage=function(a){return function(b){return function(){return b.currentPageNumber(a)}}(this)},c.prototype.pageClass=function(a){return e(function(b){return function(){return b.currentPageNumber()===a?"active":void 0}}(this))},c}()}).call(this); +(function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};this.DataTable=function(){function c(b,c){this.getLimitedPages=a(this.getLimitedPages,this),this.getPages=a(this.getPages,this);var d;if(c||(b instanceof Array?c={}:(c=b,b=[])),this.options={recordWord:c.recordWord||"record",recordWordPlural:c.recordWordPlural,sortDir:c.sortDir||"asc",sortField:c.sortField||void 0,perPage:c.perPage||15,paginationLimit:c.paginationLimit||10,filterFn:c.filterFn||void 0,alwaysMatch:c.alwaysMatch||!1,unsortedClass:c.unsortedClass||"",descSortClass:c.descSortClass||"",ascSortClass:c.ascSortClass||""},this.initObservables(),(d=c.serverSidePagination)&&d.enabled){if(!d.path||!d.loader)throw new Error("`path` or `loader` missing from `serverSidePagination` object");this.options.paginationPath=d.path,this.options.resultHandlerFn=d.loader,this.initWithServerSidePagination()}else this.initWithClientSidePagination(b)}var d,e;return e=ko.pureComputed||ko.computed,d=function(a,b){return null==b?null==a:null!=a?"boolean"==typeof a?a===b:a.toString().toLowerCase().indexOf(b.toString().toLowerCase())>=0||a===b:!1},c.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable(""),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},c.prototype.getPages=function(a){var b,c,d,e,f;for(e=this.perPage(),f=0,c=1,d=new Array(Math.ceil(a/e));a>f;)b={number:c,start:f,end:Math.min(a-1,f+e-1)},b.blanks=new Array(d.length>1?e-(b.end-b.start+1):0),d[c-1]=b,c++,f+=e;return d},c.prototype.getLimitedPages=function(){var a,b,c,d,e,f,g;return f=this.pages(),a=this.currentPageNumber(),e=this.options.paginationLimit,f.length<=e?f:(d=Math.floor(e/2),b=a-Math.floor(d),1>b?f.slice(0,e):(g=e%2===0?d-1:d,c=a+g,c>f.length?f.slice(f.length-e,f.length):f.slice(b-1,c)))},c.prototype.initWithClientSidePagination=function(a){var c;return this.filtering=ko.observable(!1),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.rows(a),this.rowAttributeMap=e(function(b){return function(){var c,d,e;if(a=b.rows(),c={},a.length>0){e=a[0];for(d in e)e.hasOwnProperty(d)&&(c[d.toLowerCase()]=d)}return c}}(this)),this.filteredRows=e(function(b){return function(){var c,d;return b.filtering(!0),c=b.filter(),a=b.rows.slice(0),(b.options.alwaysMatch||""!==c)&&(d=b.filterFn(c),a=a.filter(d)),null!=b.sortField()&&""!==b.sortField()&&a.sort(function(a,c){var d,e;return d=ko.utils.unwrapObservable(a[b.sortField()]),e=ko.utils.unwrapObservable(c[b.sortField()]),"string"==typeof d&&(d=d.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),"asc"===b.sortDir()?e>d||""===d||null==d?-1:d>e||""===e||null==e?1:0:e>d||""===d||null==d?1:d>e||""===e||null==e?-1:0}),b.filtering(!1),a}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.filteredRows().length)}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages().length>0?a.pages()[a.currentPageNumber()-1]:{number:1,start:0,end:0,blanks:[]}}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.total=e(function(a){return function(){return a.filteredRows().length}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return b=a.from(),e=a.to(),f=a.total(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(a){return function(b){return a.rows.push(b)}}(this),this.removeRecord=function(a){return function(b){return a.rows.remove(b),0===a.pagedRows().length?a.prevPage():void 0}}(this),this.replaceRows=function(a){return function(b){return a.rows(b),a.currentPageNumber(1),a.filter(void 0)}}(this),c=function(a,b,c){var e,f;return function(){var a;a=[];for(e in c)f=c[e],a.push(f);return a}().some(function(c){return d(ko.isObservable(b[c])?b[c]():b[c],a)})},this.filterFn=this.options.filterFn||function(a){return function(e){var f,g,h;return h=[[],{}],f=h[0],g=h[1],e.split(" ").forEach(function(a){var b;return a.indexOf(":")>=0?(b=a.split(":"),g[b[0]]=function(){switch(b[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return b[1].toLowerCase()}}()):f.push(a)}),f=f.join(" "),function(e){var h,i,j;return h=function(){var a;a=[];for(i in g)j=g[i],a.push(function(a){return function(b,c){var f;return(f=a.rowAttributeMap()[b.toLowerCase()])?d(ko.isObservable(e[f])?e[f]():e[f],c):!1}}(this)(i,j));return a}.call(a),b.call(h,!1)<0&&(a.options.alwaysMatch||""!==f?null!=e.match?e.match(f):c(f,e,a.rowAttributeMap()):!0)}}}(this)},c.prototype.initWithServerSidePagination=function(){var a,b;return b=function(a){return function(b,c){var d,e,f,g;return f=""+a.options.paginationPath+"?"+function(){var a;a=[];for(d in b)g=b[d],a.push(""+encodeURIComponent(d)+"="+encodeURIComponent(g));return a}().join("&"),e=new XMLHttpRequest,e.open("GET",f,!0),e.setRequestHeader("Content-Type","application/json"),e.onload=function(){return e.status>=200&&e.status<400?c(null,JSON.parse(e.responseText)):c(new Error("Error communicating with server"))},e.onerror=function(){return c(new Error("Error communicating with server"))},e.send()}}(this),a=function(a,b,c,d,e){var f;return f={perPage:a,page:b},null!=c&&""!==c&&(f.filter=c),null!=d&&""!==d&&null!=e&&""!==e&&(f.sortDir=d,f.sortBy=e),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),ko.computed(function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.numFilteredRows())}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages()[a.currentPageNumber()-1]}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return f=a.numFilteredRows(),b=a.from(),e=a.to(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled")},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled")},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled")},this.refreshData=function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)},c.prototype.toggleSort=function(a){return function(b){return function(){return b.currentPageNumber(1),b.sortField()===a?b.sortDir("asc"===b.sortDir()?"desc":"asc"):(b.sortDir("asc"),b.sortField(a))}}(this)},c.prototype.prevPage=function(){var a;return a=this.currentPageNumber(),1!==a?this.currentPageNumber(a-1):void 0},c.prototype.nextPage=function(){var a;return a=this.currentPageNumber(),a!==this.pages().length?this.currentPageNumber(a+1):void 0},c.prototype.gotoPage=function(a){return function(b){return function(){return b.currentPageNumber(a)}}(this)},c.prototype.pageClass=function(a){return e(function(b){return function(){return b.currentPageNumber()===a?"active":void 0}}(this))},c}()}).call(this); //# sourceMappingURL=knockout-datatable.min.js.map \ No newline at end of file diff --git a/knockout-datatable.min.js.map b/knockout-datatable.min.js.map index 8fd0216..f92ee50 100644 --- a/knockout-datatable.min.js.map +++ b/knockout-datatable.min.js.map @@ -1 +1 @@ -{"version":3,"file":"knockout-datatable.min.js","sources":["knockout-datatable.js"],"names":["__bind","fn","me","apply","arguments","__indexOf","indexOf","item","i","l","this","length","DataTable","rows","options","getLimitedPages","getPages","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","observable","currentPageNumber","filter","loading","observableArray","rowCount","page","pageNumber","pagesArr","rowIndex","Math","ceil","number","start","end","min","blanks","current","firstPage","lastPage","leftMargin","limit","pages","rightMargin","floor","slice","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","extend","rateLimit","method","limitedPages","currentPage","pagedRows","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","status","JSON","parse","responseText","onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map","refreshData","toggleSort","field","nextPage","gotoPage","pageClass"],"mappings":"CAAA,WACE,GAAIA,GAAS,SAASC,EAAIC,GAAK,MAAO,YAAY,MAAOD,GAAGE,MAAMD,EAAIE,aACpEC,KAAeC,SAAW,SAASC,GAAQ,IAAK,GAAIC,GAAI,EAAGC,EAAIC,KAAKC,OAAYF,EAAJD,EAAOA,IAAO,GAAIA,IAAKE,OAAQA,KAAKF,KAAOD,EAAM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AmBC,EAAM,SAASiB,EAAKC,GAC5C,GAAIC,GAASpD,CAGb,OAFAtB,GAAM1B,SAAQ,GACd0B,EAAMF,WAAU,GACZ0E,EACKG,QAAQC,IAAIJ,IAErBlD,EAAQmD,EAASnD,MAAOoD,EAAUD,EAASC,QAC3C1E,EAAMuE,gBAAgBjD,GACftB,EAAMmB,UAAUuD,EAAQG,IAAI7E,EAAM/D,QAAQsB,uBAGpD1B,OAGLE,EAAUmC,UAAU6G,WAAa,SAASC,GACxC,MAAO,UAAUhF,GACf,MAAO,YAEL,MADAA,GAAM5B,kBAAkB,GACpB4B,EAAMvD,cAAgBuI,EACjBhF,EAAMxD,QAA4B,QAApBwD,EAAMxD,UAAsB,OAAS,QAE1DwD,EAAMxD,QAAQ,OACPwD,EAAMvD,UAAUuI,MAG1BnJ,OAGLE,EAAUmC,UAAUiE,SAAW,WAC7B,GAAI1D,EAEJ,OADAA,GAAO5C,KAAKuC,oBACC,IAATK,EACK5C,KAAKuC,kBAAkBK,EAAO,GADvC,QAKF1C,EAAUmC,UAAU+G,SAAW,WAC7B,GAAIxG,EAEJ,OADAA,GAAO5C,KAAKuC,oBACRK,IAAS5C,KAAK4D,QAAQ3D,OACjBD,KAAKuC,kBAAkBK,EAAO,GADvC,QAKF1C,EAAUmC,UAAUgH,SAAW,SAASzG,GACtC,MAAO,UAAUuB,GACf,MAAO,YACL,MAAOA,GAAM5B,kBAAkBK,KAEhC5C,OAGLE,EAAUmC,UAAUiH,UAAY,SAAS1G,GACvC,MAAOd,GAAa,SAAUqC,GAC5B,MAAO,YACL,MAAIA,GAAM5B,sBAAwBK,EACzB,SADT,SAID5C,QAGEE,OAIRoH,KAAKtH"} \ No newline at end of file +{"version":3,"file":"knockout-datatable.min.js","sources":["knockout-datatable.js"],"names":["__bind","fn","me","apply","arguments","__indexOf","indexOf","item","i","l","this","length","DataTable","rows","options","getLimitedPages","getPages","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","alwaysMatch","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","observable","currentPageNumber","filter","loading","observableArray","rowCount","page","pageNumber","pagesArr","rowIndex","Math","ceil","number","start","end","min","blanks","current","firstPage","lastPage","leftMargin","limit","pages","rightMargin","floor","slice","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","extend","rateLimit","method","limitedPages","currentPage","pagedRows","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","status","JSON","parse","responseText","onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map","refreshData","toggleSort","field","nextPage","gotoPage","pageClass"],"mappings":"CAAA,WACE,GAAIA,GAAS,SAASC,EAAIC,GAAK,MAAO,YAAY,MAAOD,GAAGE,MAAMD,EAAIE,aACpEC,KAAeC,SAAW,SAASC,GAAQ,IAAK,GAAIC,GAAI,EAAGC,EAAIC,KAAKC,OAAYF,EAAJD,EAAOA,IAAO,GAAIA,IAAKE,OAAQA,KAAKF,KAAOD,EAAM,MAAOC,EAAK,OAAO,GAElJE,MAAKE,UAAY,WAmBf,QAASA,GAAUC,EAAMC,GACvBJ,KAAKK,gBAAkBf,EAAOU,KAAKK,gBAAiBL,MACpDA,KAAKM,SAAWhB,EAAOU,KAAKM,SAAUN,KACtC,IAAIO,EAuBJ,IAtBKH,IACGD,YAAgBK,OAIpBJ,MAHAA,EAAUD,EACVA,OAKJH,KAAKI,SACHK,WAAYL,EAAQK,YAAc,SAClC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GACftB,EAAMmB,UAAUuD,EAAQG,IAAI7E,EAAMhE,QAAQuB,uBAGpD3B,OAGLE,EAAUoC,UAAU6G,WAAa,SAASC,GACxC,MAAO,UAAUhF,GACf,MAAO,YAEL,MADAA,GAAM5B,kBAAkB,GACpB4B,EAAMxD,cAAgBwI,EACjBhF,EAAMzD,QAA4B,QAApByD,EAAMzD,UAAsB,OAAS,QAE1DyD,EAAMzD,QAAQ,OACPyD,EAAMxD,UAAUwI,MAG1BpJ,OAGLE,EAAUoC,UAAUiE,SAAW,WAC7B,GAAI1D,EAEJ,OADAA,GAAO7C,KAAKwC,oBACC,IAATK,EACK7C,KAAKwC,kBAAkBK,EAAO,GADvC,QAKF3C,EAAUoC,UAAU+G,SAAW,WAC7B,GAAIxG,EAEJ,OADAA,GAAO7C,KAAKwC,oBACRK,IAAS7C,KAAK6D,QAAQ5D,OACjBD,KAAKwC,kBAAkBK,EAAO,GADvC,QAKF3C,EAAUoC,UAAUgH,SAAW,SAASzG,GACtC,MAAO,UAAUuB,GACf,MAAO,YACL,MAAOA,GAAM5B,kBAAkBK,KAEhC7C,OAGLE,EAAUoC,UAAUiH,UAAY,SAAS1G,GACvC,MAAOd,GAAa,SAAUqC,GAC5B,MAAO,YACL,MAAIA,GAAM5B,sBAAwBK,EACzB,SADT,SAID7C,QAGEE,OAIRqH,KAAKvH"} \ No newline at end of file From 69de9258c35281a4a505d29cfd1eec47976c164c Mon Sep 17 00:00:00 2001 From: Ohad Schneider Date: Sat, 23 May 2015 15:25:58 +0300 Subject: [PATCH 6/8] rate-limit filter observable --- knockout-datatable.coffee | 2 +- knockout-datatable.js | 7 ++++++- knockout-datatable.min.js | 2 +- knockout-datatable.min.js.map | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/knockout-datatable.coffee b/knockout-datatable.coffee index 0daf87f..ef55a53 100644 --- a/knockout-datatable.coffee +++ b/knockout-datatable.coffee @@ -55,7 +55,7 @@ class @DataTable @sortField = ko.observable @options.sortField @perPage = ko.observable @options.perPage @currentPageNumber = ko.observable 1 - @filter = ko.observable '' + @filter = ko.observable('').extend({ rateLimit: { method: "notifyWhenChangesStop", timeout: 400 } }); @loading = ko.observable false @rows = ko.observableArray [] diff --git a/knockout-datatable.js b/knockout-datatable.js index 0004c55..b373441 100644 --- a/knockout-datatable.js +++ b/knockout-datatable.js @@ -64,7 +64,12 @@ this.sortField = ko.observable(this.options.sortField); this.perPage = ko.observable(this.options.perPage); this.currentPageNumber = ko.observable(1); - this.filter = ko.observable(''); + this.filter = ko.observable('').extend({ + rateLimit: { + method: "notifyWhenChangesStop", + timeout: 400 + } + }); this.loading = ko.observable(false); return this.rows = ko.observableArray([]); }; diff --git a/knockout-datatable.min.js b/knockout-datatable.min.js index fc5397c..28a6a07 100644 --- a/knockout-datatable.min.js +++ b/knockout-datatable.min.js @@ -1,2 +1,2 @@ -(function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};this.DataTable=function(){function c(b,c){this.getLimitedPages=a(this.getLimitedPages,this),this.getPages=a(this.getPages,this);var d;if(c||(b instanceof Array?c={}:(c=b,b=[])),this.options={recordWord:c.recordWord||"record",recordWordPlural:c.recordWordPlural,sortDir:c.sortDir||"asc",sortField:c.sortField||void 0,perPage:c.perPage||15,paginationLimit:c.paginationLimit||10,filterFn:c.filterFn||void 0,alwaysMatch:c.alwaysMatch||!1,unsortedClass:c.unsortedClass||"",descSortClass:c.descSortClass||"",ascSortClass:c.ascSortClass||""},this.initObservables(),(d=c.serverSidePagination)&&d.enabled){if(!d.path||!d.loader)throw new Error("`path` or `loader` missing from `serverSidePagination` object");this.options.paginationPath=d.path,this.options.resultHandlerFn=d.loader,this.initWithServerSidePagination()}else this.initWithClientSidePagination(b)}var d,e;return e=ko.pureComputed||ko.computed,d=function(a,b){return null==b?null==a:null!=a?"boolean"==typeof a?a===b:a.toString().toLowerCase().indexOf(b.toString().toLowerCase())>=0||a===b:!1},c.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable(""),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},c.prototype.getPages=function(a){var b,c,d,e,f;for(e=this.perPage(),f=0,c=1,d=new Array(Math.ceil(a/e));a>f;)b={number:c,start:f,end:Math.min(a-1,f+e-1)},b.blanks=new Array(d.length>1?e-(b.end-b.start+1):0),d[c-1]=b,c++,f+=e;return d},c.prototype.getLimitedPages=function(){var a,b,c,d,e,f,g;return f=this.pages(),a=this.currentPageNumber(),e=this.options.paginationLimit,f.length<=e?f:(d=Math.floor(e/2),b=a-Math.floor(d),1>b?f.slice(0,e):(g=e%2===0?d-1:d,c=a+g,c>f.length?f.slice(f.length-e,f.length):f.slice(b-1,c)))},c.prototype.initWithClientSidePagination=function(a){var c;return this.filtering=ko.observable(!1),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.rows(a),this.rowAttributeMap=e(function(b){return function(){var c,d,e;if(a=b.rows(),c={},a.length>0){e=a[0];for(d in e)e.hasOwnProperty(d)&&(c[d.toLowerCase()]=d)}return c}}(this)),this.filteredRows=e(function(b){return function(){var c,d;return b.filtering(!0),c=b.filter(),a=b.rows.slice(0),(b.options.alwaysMatch||""!==c)&&(d=b.filterFn(c),a=a.filter(d)),null!=b.sortField()&&""!==b.sortField()&&a.sort(function(a,c){var d,e;return d=ko.utils.unwrapObservable(a[b.sortField()]),e=ko.utils.unwrapObservable(c[b.sortField()]),"string"==typeof d&&(d=d.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),"asc"===b.sortDir()?e>d||""===d||null==d?-1:d>e||""===e||null==e?1:0:e>d||""===d||null==d?1:d>e||""===e||null==e?-1:0}),b.filtering(!1),a}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.filteredRows().length)}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages().length>0?a.pages()[a.currentPageNumber()-1]:{number:1,start:0,end:0,blanks:[]}}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.total=e(function(a){return function(){return a.filteredRows().length}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return b=a.from(),e=a.to(),f=a.total(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(a){return function(b){return a.rows.push(b)}}(this),this.removeRecord=function(a){return function(b){return a.rows.remove(b),0===a.pagedRows().length?a.prevPage():void 0}}(this),this.replaceRows=function(a){return function(b){return a.rows(b),a.currentPageNumber(1),a.filter(void 0)}}(this),c=function(a,b,c){var e,f;return function(){var a;a=[];for(e in c)f=c[e],a.push(f);return a}().some(function(c){return d(ko.isObservable(b[c])?b[c]():b[c],a)})},this.filterFn=this.options.filterFn||function(a){return function(e){var f,g,h;return h=[[],{}],f=h[0],g=h[1],e.split(" ").forEach(function(a){var b;return a.indexOf(":")>=0?(b=a.split(":"),g[b[0]]=function(){switch(b[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return b[1].toLowerCase()}}()):f.push(a)}),f=f.join(" "),function(e){var h,i,j;return h=function(){var a;a=[];for(i in g)j=g[i],a.push(function(a){return function(b,c){var f;return(f=a.rowAttributeMap()[b.toLowerCase()])?d(ko.isObservable(e[f])?e[f]():e[f],c):!1}}(this)(i,j));return a}.call(a),b.call(h,!1)<0&&(a.options.alwaysMatch||""!==f?null!=e.match?e.match(f):c(f,e,a.rowAttributeMap()):!0)}}}(this)},c.prototype.initWithServerSidePagination=function(){var a,b;return b=function(a){return function(b,c){var d,e,f,g;return f=""+a.options.paginationPath+"?"+function(){var a;a=[];for(d in b)g=b[d],a.push(""+encodeURIComponent(d)+"="+encodeURIComponent(g));return a}().join("&"),e=new XMLHttpRequest,e.open("GET",f,!0),e.setRequestHeader("Content-Type","application/json"),e.onload=function(){return e.status>=200&&e.status<400?c(null,JSON.parse(e.responseText)):c(new Error("Error communicating with server"))},e.onerror=function(){return c(new Error("Error communicating with server"))},e.send()}}(this),a=function(a,b,c,d,e){var f;return f={perPage:a,page:b},null!=c&&""!==c&&(f.filter=c),null!=d&&""!==d&&null!=e&&""!==e&&(f.sortDir=d,f.sortBy=e),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),ko.computed(function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.numFilteredRows())}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages()[a.currentPageNumber()-1]}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return f=a.numFilteredRows(),b=a.from(),e=a.to(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled")},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled")},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled")},this.refreshData=function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)},c.prototype.toggleSort=function(a){return function(b){return function(){return b.currentPageNumber(1),b.sortField()===a?b.sortDir("asc"===b.sortDir()?"desc":"asc"):(b.sortDir("asc"),b.sortField(a))}}(this)},c.prototype.prevPage=function(){var a;return a=this.currentPageNumber(),1!==a?this.currentPageNumber(a-1):void 0},c.prototype.nextPage=function(){var a;return a=this.currentPageNumber(),a!==this.pages().length?this.currentPageNumber(a+1):void 0},c.prototype.gotoPage=function(a){return function(b){return function(){return b.currentPageNumber(a)}}(this)},c.prototype.pageClass=function(a){return e(function(b){return function(){return b.currentPageNumber()===a?"active":void 0}}(this))},c}()}).call(this); +(function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};this.DataTable=function(){function c(b,c){this.getLimitedPages=a(this.getLimitedPages,this),this.getPages=a(this.getPages,this);var d;if(c||(b instanceof Array?c={}:(c=b,b=[])),this.options={recordWord:c.recordWord||"record",recordWordPlural:c.recordWordPlural,sortDir:c.sortDir||"asc",sortField:c.sortField||void 0,perPage:c.perPage||15,paginationLimit:c.paginationLimit||10,filterFn:c.filterFn||void 0,alwaysMatch:c.alwaysMatch||!1,unsortedClass:c.unsortedClass||"",descSortClass:c.descSortClass||"",ascSortClass:c.ascSortClass||""},this.initObservables(),(d=c.serverSidePagination)&&d.enabled){if(!d.path||!d.loader)throw new Error("`path` or `loader` missing from `serverSidePagination` object");this.options.paginationPath=d.path,this.options.resultHandlerFn=d.loader,this.initWithServerSidePagination()}else this.initWithClientSidePagination(b)}var d,e;return e=ko.pureComputed||ko.computed,d=function(a,b){return null==b?null==a:null!=a?"boolean"==typeof a?a===b:a.toString().toLowerCase().indexOf(b.toString().toLowerCase())>=0||a===b:!1},c.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable("").extend({rateLimit:{method:"notifyWhenChangesStop",timeout:400}}),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},c.prototype.getPages=function(a){var b,c,d,e,f;for(e=this.perPage(),f=0,c=1,d=new Array(Math.ceil(a/e));a>f;)b={number:c,start:f,end:Math.min(a-1,f+e-1)},b.blanks=new Array(d.length>1?e-(b.end-b.start+1):0),d[c-1]=b,c++,f+=e;return d},c.prototype.getLimitedPages=function(){var a,b,c,d,e,f,g;return f=this.pages(),a=this.currentPageNumber(),e=this.options.paginationLimit,f.length<=e?f:(d=Math.floor(e/2),b=a-Math.floor(d),1>b?f.slice(0,e):(g=e%2===0?d-1:d,c=a+g,c>f.length?f.slice(f.length-e,f.length):f.slice(b-1,c)))},c.prototype.initWithClientSidePagination=function(a){var c;return this.filtering=ko.observable(!1),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.rows(a),this.rowAttributeMap=e(function(b){return function(){var c,d,e;if(a=b.rows(),c={},a.length>0){e=a[0];for(d in e)e.hasOwnProperty(d)&&(c[d.toLowerCase()]=d)}return c}}(this)),this.filteredRows=e(function(b){return function(){var c,d;return b.filtering(!0),c=b.filter(),a=b.rows.slice(0),(b.options.alwaysMatch||""!==c)&&(d=b.filterFn(c),a=a.filter(d)),null!=b.sortField()&&""!==b.sortField()&&a.sort(function(a,c){var d,e;return d=ko.utils.unwrapObservable(a[b.sortField()]),e=ko.utils.unwrapObservable(c[b.sortField()]),"string"==typeof d&&(d=d.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),"asc"===b.sortDir()?e>d||""===d||null==d?-1:d>e||""===e||null==e?1:0:e>d||""===d||null==d?1:d>e||""===e||null==e?-1:0}),b.filtering(!1),a}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.filteredRows().length)}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages().length>0?a.pages()[a.currentPageNumber()-1]:{number:1,start:0,end:0,blanks:[]}}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.total=e(function(a){return function(){return a.filteredRows().length}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return b=a.from(),e=a.to(),f=a.total(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(a){return function(b){return a.rows.push(b)}}(this),this.removeRecord=function(a){return function(b){return a.rows.remove(b),0===a.pagedRows().length?a.prevPage():void 0}}(this),this.replaceRows=function(a){return function(b){return a.rows(b),a.currentPageNumber(1),a.filter(void 0)}}(this),c=function(a,b,c){var e,f;return function(){var a;a=[];for(e in c)f=c[e],a.push(f);return a}().some(function(c){return d(ko.isObservable(b[c])?b[c]():b[c],a)})},this.filterFn=this.options.filterFn||function(a){return function(e){var f,g,h;return h=[[],{}],f=h[0],g=h[1],e.split(" ").forEach(function(a){var b;return a.indexOf(":")>=0?(b=a.split(":"),g[b[0]]=function(){switch(b[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return b[1].toLowerCase()}}()):f.push(a)}),f=f.join(" "),function(e){var h,i,j;return h=function(){var a;a=[];for(i in g)j=g[i],a.push(function(a){return function(b,c){var f;return(f=a.rowAttributeMap()[b.toLowerCase()])?d(ko.isObservable(e[f])?e[f]():e[f],c):!1}}(this)(i,j));return a}.call(a),b.call(h,!1)<0&&(a.options.alwaysMatch||""!==f?null!=e.match?e.match(f):c(f,e,a.rowAttributeMap()):!0)}}}(this)},c.prototype.initWithServerSidePagination=function(){var a,b;return b=function(a){return function(b,c){var d,e,f,g;return f=""+a.options.paginationPath+"?"+function(){var a;a=[];for(d in b)g=b[d],a.push(""+encodeURIComponent(d)+"="+encodeURIComponent(g));return a}().join("&"),e=new XMLHttpRequest,e.open("GET",f,!0),e.setRequestHeader("Content-Type","application/json"),e.onload=function(){return e.status>=200&&e.status<400?c(null,JSON.parse(e.responseText)):c(new Error("Error communicating with server"))},e.onerror=function(){return c(new Error("Error communicating with server"))},e.send()}}(this),a=function(a,b,c,d,e){var f;return f={perPage:a,page:b},null!=c&&""!==c&&(f.filter=c),null!=d&&""!==d&&null!=e&&""!==e&&(f.sortDir=d,f.sortBy=e),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),ko.computed(function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.numFilteredRows())}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages()[a.currentPageNumber()-1]}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return f=a.numFilteredRows(),b=a.from(),e=a.to(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled")},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled")},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled")},this.refreshData=function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)},c.prototype.toggleSort=function(a){return function(b){return function(){return b.currentPageNumber(1),b.sortField()===a?b.sortDir("asc"===b.sortDir()?"desc":"asc"):(b.sortDir("asc"),b.sortField(a))}}(this)},c.prototype.prevPage=function(){var a;return a=this.currentPageNumber(),1!==a?this.currentPageNumber(a-1):void 0},c.prototype.nextPage=function(){var a;return a=this.currentPageNumber(),a!==this.pages().length?this.currentPageNumber(a+1):void 0},c.prototype.gotoPage=function(a){return function(b){return function(){return b.currentPageNumber(a)}}(this)},c.prototype.pageClass=function(a){return e(function(b){return function(){return b.currentPageNumber()===a?"active":void 0}}(this))},c}()}).call(this); //# sourceMappingURL=knockout-datatable.min.js.map \ No newline at end of file diff --git a/knockout-datatable.min.js.map b/knockout-datatable.min.js.map index f92ee50..aca9f23 100644 --- a/knockout-datatable.min.js.map +++ b/knockout-datatable.min.js.map @@ -1 +1 @@ -{"version":3,"file":"knockout-datatable.min.js","sources":["knockout-datatable.js"],"names":["__bind","fn","me","apply","arguments","__indexOf","indexOf","item","i","l","this","length","DataTable","rows","options","getLimitedPages","getPages","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","alwaysMatch","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","observable","currentPageNumber","filter","loading","observableArray","rowCount","page","pageNumber","pagesArr","rowIndex","Math","ceil","number","start","end","min","blanks","current","firstPage","lastPage","leftMargin","limit","pages","rightMargin","floor","slice","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","extend","rateLimit","method","limitedPages","currentPage","pagedRows","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","status","JSON","parse","responseText","onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map","refreshData","toggleSort","field","nextPage","gotoPage","pageClass"],"mappings":"CAAA,WACE,GAAIA,GAAS,SAASC,EAAIC,GAAK,MAAO,YAAY,MAAOD,GAAGE,MAAMD,EAAIE,aACpEC,KAAeC,SAAW,SAASC,GAAQ,IAAK,GAAIC,GAAI,EAAGC,EAAIC,KAAKC,OAAYF,E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.js"],"names":["__bind","fn","me","apply","arguments","__indexOf","indexOf","item","i","l","this","length","DataTable","rows","options","getLimitedPages","getPages","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","alwaysMatch","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","observable","currentPageNumber","filter","extend","rateLimit","method","timeout","loading","observableArray","rowCount","page","pageNumber","pagesArr","rowIndex","Math","ceil","number","start","end","min","blanks","current","firstPage","lastPage","leftMargin","limit","pages","rightMargin","floor","slice","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","limitedPages","currentPage","pagedRows","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","status","JSON","parse","responseText","onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map","refreshData","toggleSort","field","nextPage","gotoPage","pageClass"],"mappings":"CAAA,WACE,GAAIA,GAAS,SAASC,EAAIC,GAAK,MAAO,YAAY,MAAOD,GAAGE,MAAMD,EAAIE,aACpEC,KAAeC,SAAW,SAASC,GAAQ,IAAK,GAAIC,GAAI,EAAGC,EAAIC,KAAKC,OAAYF,EAAJD,EAAOA,IAAO,GAAIA,IAAKE,OAAQA,KAAKF,KAAOD,EAAM,MAAOC,EAAK,OAAO,GAElJE,MAAKE,UAAY,WAmBf,QAASA,GAAUC,EAAMC,GACvBJ,KAAKK,gBAAkBf,EAAOU,KAAKK,gBAAiBL,MACpDA,KAAKM,SAAWhB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C,GAC5C,GAAIC,GAASpD,CAGb,OAFAnB,GAAM1B,SAAQ,GACd0B,EAAMF,WAAU,GACZuE,EACKG,QAAQC,IAAIJ,IAErBlD,EAAQmD,EAASnD,MAAOoD,EAAUD,EAASC,QAC3CvE,EAAMoE,gBAAgBjD,GACfnB,EAAMgB,UAAUuD,EAAQG,IAAI1E,EAAMpE,QAAQuB,uBAGpD3B,OAGLE,EAAUoC,UAAU8G,WAAa,SAASC,GACxC,MAAO,UAAU7E,GACf,MAAO,YAEL,MADAA,GAAMhC,kBAAkB,GACpBgC,EAAM5D,cAAgByI,EACjB7E,EAAM7D,QAA4B,QAApB6D,EAAM7D,UAAsB,OAAS,QAE1D6D,EAAM7D,QAAQ,OACP6D,EAAM5D,UAAUyI,MAG1BrJ,OAGLE,EAAUoC,UAAUkE,SAAW,WAC7B,GAAIvD,EAEJ,OADAA,GAAOjD,KAAKwC,oBACC,IAATS,EACKjD,KAAKwC,kBAAkBS,EAAO,GADvC,QAKF/C,EAAUoC,UAAUgH,SAAW,WAC7B,GAAIrG,EAEJ,OADAA,GAAOjD,KAAKwC,oBACRS,IAASjD,KAAKiE,QAAQhE,OACjBD,KAAKwC,kBAAkBS,EAAO,GADvC,QAKF/C,EAAUoC,UAAUiH,SAAW,SAAStG,GACtC,MAAO,UAAUuB,GACf,MAAO,YACL,MAAOA,GAAMhC,kBAAkBS,KAEhCjD,OAGLE,EAAUoC,UAAUkH,UAAY,SAASvG,GACvC,MAAOlB,GAAa,SAAUyC,GAC5B,MAAO,YACL,MAAIA,GAAMhC,sBAAwBS,EACzB,SADT,SAIDjD,QAGEE,OAIRsH,KAAKxH"} \ No newline at end of file From b52829b003a7bbc5cf65263360bfa0f515e5bfa1 Mon Sep 17 00:00:00 2001 From: Ohad Schneider Date: Sun, 24 May 2015 01:02:14 +0300 Subject: [PATCH 7/8] Allow manual triggerring of filter calculation --- knockout-datatable.coffee | 6 ++++++ knockout-datatable.js | 11 ++++++++++- knockout-datatable.min.js | 2 +- knockout-datatable.min.js.map | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/knockout-datatable.coffee b/knockout-datatable.coffee index ef55a53..f70e0a9 100644 --- a/knockout-datatable.coffee +++ b/knockout-datatable.coffee @@ -115,7 +115,13 @@ class @DataTable attrMap + filterTrigger = ko.observable().extend({notify:'always'}) + + @triggerFilterCalculation = => + filterTrigger.valueHasMutated() + @filteredRows = pureComputed => + filterTrigger() @filtering true filter = @filter() diff --git a/knockout-datatable.js b/knockout-datatable.js index b373441..ae58ae0 100644 --- a/knockout-datatable.js +++ b/knockout-datatable.js @@ -116,7 +116,7 @@ }; DataTable.prototype.initWithClientSidePagination = function(rows) { - var _defaultMatch; + var filterTrigger, _defaultMatch; this.filtering = ko.observable(false); this.filter.subscribe((function(_this) { return function() { @@ -145,9 +145,18 @@ return attrMap; }; })(this)); + filterTrigger = ko.observable().extend({ + notify: 'always' + }); + this.triggerFilterCalculation = (function(_this) { + return function() { + return filterTrigger.valueHasMutated(); + }; + })(this); this.filteredRows = pureComputed((function(_this) { return function() { var filter, filterFn; + filterTrigger(); _this.filtering(true); filter = _this.filter(); rows = _this.rows.slice(0); diff --git a/knockout-datatable.min.js b/knockout-datatable.min.js index 28a6a07..fb00445 100644 --- a/knockout-datatable.min.js +++ b/knockout-datatable.min.js @@ -1,2 +1,2 @@ -(function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};this.DataTable=function(){function c(b,c){this.getLimitedPages=a(this.getLimitedPages,this),this.getPages=a(this.getPages,this);var d;if(c||(b instanceof Array?c={}:(c=b,b=[])),this.options={recordWord:c.recordWord||"record",recordWordPlural:c.recordWordPlural,sortDir:c.sortDir||"asc",sortField:c.sortField||void 0,perPage:c.perPage||15,paginationLimit:c.paginationLimit||10,filterFn:c.filterFn||void 0,alwaysMatch:c.alwaysMatch||!1,unsortedClass:c.unsortedClass||"",descSortClass:c.descSortClass||"",ascSortClass:c.ascSortClass||""},this.initObservables(),(d=c.serverSidePagination)&&d.enabled){if(!d.path||!d.loader)throw new Error("`path` or `loader` missing from `serverSidePagination` object");this.options.paginationPath=d.path,this.options.resultHandlerFn=d.loader,this.initWithServerSidePagination()}else this.initWithClientSidePagination(b)}var d,e;return e=ko.pureComputed||ko.computed,d=function(a,b){return null==b?null==a:null!=a?"boolean"==typeof a?a===b:a.toString().toLowerCase().indexOf(b.toString().toLowerCase())>=0||a===b:!1},c.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable("").extend({rateLimit:{method:"notifyWhenChangesStop",timeout:400}}),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},c.prototype.getPages=function(a){var b,c,d,e,f;for(e=this.perPage(),f=0,c=1,d=new Array(Math.ceil(a/e));a>f;)b={number:c,start:f,end:Math.min(a-1,f+e-1)},b.blanks=new Array(d.length>1?e-(b.end-b.start+1):0),d[c-1]=b,c++,f+=e;return d},c.prototype.getLimitedPages=function(){var a,b,c,d,e,f,g;return f=this.pages(),a=this.currentPageNumber(),e=this.options.paginationLimit,f.length<=e?f:(d=Math.floor(e/2),b=a-Math.floor(d),1>b?f.slice(0,e):(g=e%2===0?d-1:d,c=a+g,c>f.length?f.slice(f.length-e,f.length):f.slice(b-1,c)))},c.prototype.initWithClientSidePagination=function(a){var c;return this.filtering=ko.observable(!1),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.rows(a),this.rowAttributeMap=e(function(b){return function(){var c,d,e;if(a=b.rows(),c={},a.length>0){e=a[0];for(d in e)e.hasOwnProperty(d)&&(c[d.toLowerCase()]=d)}return c}}(this)),this.filteredRows=e(function(b){return function(){var c,d;return b.filtering(!0),c=b.filter(),a=b.rows.slice(0),(b.options.alwaysMatch||""!==c)&&(d=b.filterFn(c),a=a.filter(d)),null!=b.sortField()&&""!==b.sortField()&&a.sort(function(a,c){var d,e;return d=ko.utils.unwrapObservable(a[b.sortField()]),e=ko.utils.unwrapObservable(c[b.sortField()]),"string"==typeof d&&(d=d.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),"asc"===b.sortDir()?e>d||""===d||null==d?-1:d>e||""===e||null==e?1:0:e>d||""===d||null==d?1:d>e||""===e||null==e?-1:0}),b.filtering(!1),a}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.filteredRows().length)}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages().length>0?a.pages()[a.currentPageNumber()-1]:{number:1,start:0,end:0,blanks:[]}}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.total=e(function(a){return function(){return a.filteredRows().length}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return b=a.from(),e=a.to(),f=a.total(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(a){return function(b){return a.rows.push(b)}}(this),this.removeRecord=function(a){return function(b){return a.rows.remove(b),0===a.pagedRows().length?a.prevPage():void 0}}(this),this.replaceRows=function(a){return function(b){return a.rows(b),a.currentPageNumber(1),a.filter(void 0)}}(this),c=function(a,b,c){var e,f;return function(){var a;a=[];for(e in c)f=c[e],a.push(f);return a}().some(function(c){return d(ko.isObservable(b[c])?b[c]():b[c],a)})},this.filterFn=this.options.filterFn||function(a){return function(e){var f,g,h;return h=[[],{}],f=h[0],g=h[1],e.split(" ").forEach(function(a){var b;return a.indexOf(":")>=0?(b=a.split(":"),g[b[0]]=function(){switch(b[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return b[1].toLowerCase()}}()):f.push(a)}),f=f.join(" "),function(e){var h,i,j;return h=function(){var a;a=[];for(i in g)j=g[i],a.push(function(a){return function(b,c){var f;return(f=a.rowAttributeMap()[b.toLowerCase()])?d(ko.isObservable(e[f])?e[f]():e[f],c):!1}}(this)(i,j));return a}.call(a),b.call(h,!1)<0&&(a.options.alwaysMatch||""!==f?null!=e.match?e.match(f):c(f,e,a.rowAttributeMap()):!0)}}}(this)},c.prototype.initWithServerSidePagination=function(){var a,b;return b=function(a){return function(b,c){var d,e,f,g;return f=""+a.options.paginationPath+"?"+function(){var a;a=[];for(d in b)g=b[d],a.push(""+encodeURIComponent(d)+"="+encodeURIComponent(g));return a}().join("&"),e=new XMLHttpRequest,e.open("GET",f,!0),e.setRequestHeader("Content-Type","application/json"),e.onload=function(){return e.status>=200&&e.status<400?c(null,JSON.parse(e.responseText)):c(new Error("Error communicating with server"))},e.onerror=function(){return c(new Error("Error communicating with server"))},e.send()}}(this),a=function(a,b,c,d,e){var f;return f={perPage:a,page:b},null!=c&&""!==c&&(f.filter=c),null!=d&&""!==d&&null!=e&&""!==e&&(f.sortDir=d,f.sortBy=e),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),ko.computed(function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.numFilteredRows())}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages()[a.currentPageNumber()-1]}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return f=a.numFilteredRows(),b=a.from(),e=a.to(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled")},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled")},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled")},this.refreshData=function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)},c.prototype.toggleSort=function(a){return function(b){return function(){return b.currentPageNumber(1),b.sortField()===a?b.sortDir("asc"===b.sortDir()?"desc":"asc"):(b.sortDir("asc"),b.sortField(a))}}(this)},c.prototype.prevPage=function(){var a;return a=this.currentPageNumber(),1!==a?this.currentPageNumber(a-1):void 0},c.prototype.nextPage=function(){var a;return a=this.currentPageNumber(),a!==this.pages().length?this.currentPageNumber(a+1):void 0},c.prototype.gotoPage=function(a){return function(b){return function(){return b.currentPageNumber(a)}}(this)},c.prototype.pageClass=function(a){return e(function(b){return function(){return b.currentPageNumber()===a?"active":void 0}}(this))},c}()}).call(this); +(function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};this.DataTable=function(){function c(b,c){this.getLimitedPages=a(this.getLimitedPages,this),this.getPages=a(this.getPages,this);var d;if(c||(b instanceof Array?c={}:(c=b,b=[])),this.options={recordWord:c.recordWord||"record",recordWordPlural:c.recordWordPlural,sortDir:c.sortDir||"asc",sortField:c.sortField||void 0,perPage:c.perPage||15,paginationLimit:c.paginationLimit||10,filterFn:c.filterFn||void 0,alwaysMatch:c.alwaysMatch||!1,unsortedClass:c.unsortedClass||"",descSortClass:c.descSortClass||"",ascSortClass:c.ascSortClass||""},this.initObservables(),(d=c.serverSidePagination)&&d.enabled){if(!d.path||!d.loader)throw new Error("`path` or `loader` missing from `serverSidePagination` object");this.options.paginationPath=d.path,this.options.resultHandlerFn=d.loader,this.initWithServerSidePagination()}else this.initWithClientSidePagination(b)}var d,e;return e=ko.pureComputed||ko.computed,d=function(a,b){return null==b?null==a:null!=a?"boolean"==typeof a?a===b:a.toString().toLowerCase().indexOf(b.toString().toLowerCase())>=0||a===b:!1},c.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable("").extend({rateLimit:{method:"notifyWhenChangesStop",timeout:400}}),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},c.prototype.getPages=function(a){var b,c,d,e,f;for(e=this.perPage(),f=0,c=1,d=new Array(Math.ceil(a/e));a>f;)b={number:c,start:f,end:Math.min(a-1,f+e-1)},b.blanks=new Array(d.length>1?e-(b.end-b.start+1):0),d[c-1]=b,c++,f+=e;return d},c.prototype.getLimitedPages=function(){var a,b,c,d,e,f,g;return f=this.pages(),a=this.currentPageNumber(),e=this.options.paginationLimit,f.length<=e?f:(d=Math.floor(e/2),b=a-Math.floor(d),1>b?f.slice(0,e):(g=e%2===0?d-1:d,c=a+g,c>f.length?f.slice(f.length-e,f.length):f.slice(b-1,c)))},c.prototype.initWithClientSidePagination=function(a){var c,f;return this.filtering=ko.observable(!1),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.rows(a),this.rowAttributeMap=e(function(b){return function(){var c,d,e;if(a=b.rows(),c={},a.length>0){e=a[0];for(d in e)e.hasOwnProperty(d)&&(c[d.toLowerCase()]=d)}return c}}(this)),c=ko.observable().extend({notify:"always"}),this.triggerFilterCalculation=function(){return function(){return c.valueHasMutated()}}(this),this.filteredRows=e(function(b){return function(){var d,e;return c(),b.filtering(!0),d=b.filter(),a=b.rows.slice(0),(b.options.alwaysMatch||""!==d)&&(e=b.filterFn(d),a=a.filter(e)),null!=b.sortField()&&""!==b.sortField()&&a.sort(function(a,c){var d,e;return d=ko.utils.unwrapObservable(a[b.sortField()]),e=ko.utils.unwrapObservable(c[b.sortField()]),"string"==typeof d&&(d=d.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),"asc"===b.sortDir()?e>d||""===d||null==d?-1:d>e||""===e||null==e?1:0:e>d||""===d||null==d?1:d>e||""===e||null==e?-1:0}),b.filtering(!1),a}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.filteredRows().length)}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages().length>0?a.pages()[a.currentPageNumber()-1]:{number:1,start:0,end:0,blanks:[]}}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.total=e(function(a){return function(){return a.filteredRows().length}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return b=a.from(),e=a.to(),f=a.total(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(a){return function(b){return a.rows.push(b)}}(this),this.removeRecord=function(a){return function(b){return a.rows.remove(b),0===a.pagedRows().length?a.prevPage():void 0}}(this),this.replaceRows=function(a){return function(b){return a.rows(b),a.currentPageNumber(1),a.filter(void 0)}}(this),f=function(a,b,c){var e,f;return function(){var a;a=[];for(e in c)f=c[e],a.push(f);return a}().some(function(c){return d(ko.isObservable(b[c])?b[c]():b[c],a)})},this.filterFn=this.options.filterFn||function(a){return function(c){var e,g,h;return h=[[],{}],e=h[0],g=h[1],c.split(" ").forEach(function(a){var b;return a.indexOf(":")>=0?(b=a.split(":"),g[b[0]]=function(){switch(b[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return b[1].toLowerCase()}}()):e.push(a)}),e=e.join(" "),function(c){var h,i,j;return h=function(){var a;a=[];for(i in g)j=g[i],a.push(function(a){return function(b,e){var f;return(f=a.rowAttributeMap()[b.toLowerCase()])?d(ko.isObservable(c[f])?c[f]():c[f],e):!1}}(this)(i,j));return a}.call(a),b.call(h,!1)<0&&(a.options.alwaysMatch||""!==e?null!=c.match?c.match(e):f(e,c,a.rowAttributeMap()):!0)}}}(this)},c.prototype.initWithServerSidePagination=function(){var a,b;return b=function(a){return function(b,c){var d,e,f,g;return f=""+a.options.paginationPath+"?"+function(){var a;a=[];for(d in b)g=b[d],a.push(""+encodeURIComponent(d)+"="+encodeURIComponent(g));return a}().join("&"),e=new XMLHttpRequest,e.open("GET",f,!0),e.setRequestHeader("Content-Type","application/json"),e.onload=function(){return e.status>=200&&e.status<400?c(null,JSON.parse(e.responseText)):c(new Error("Error communicating with server"))},e.onerror=function(){return c(new Error("Error communicating with server"))},e.send()}}(this),a=function(a,b,c,d,e){var f;return f={perPage:a,page:b},null!=c&&""!==c&&(f.filter=c),null!=d&&""!==d&&null!=e&&""!==e&&(f.sortDir=d,f.sortBy=e),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),ko.computed(function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.numFilteredRows())}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages()[a.currentPageNumber()-1]}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return f=a.numFilteredRows(),b=a.from(),e=a.to(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled")},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled")},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled")},this.refreshData=function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)},c.prototype.toggleSort=function(a){return function(b){return function(){return b.currentPageNumber(1),b.sortField()===a?b.sortDir("asc"===b.sortDir()?"desc":"asc"):(b.sortDir("asc"),b.sortField(a))}}(this)},c.prototype.prevPage=function(){var a;return a=this.currentPageNumber(),1!==a?this.currentPageNumber(a-1):void 0},c.prototype.nextPage=function(){var a;return a=this.currentPageNumber(),a!==this.pages().length?this.currentPageNumber(a+1):void 0},c.prototype.gotoPage=function(a){return function(b){return function(){return b.currentPageNumber(a)}}(this)},c.prototype.pageClass=function(a){return e(function(b){return function(){return b.currentPageNumber()===a?"active":void 0}}(this))},c}()}).call(this); //# sourceMappingURL=knockout-datatable.min.js.map \ No newline at end of file diff --git a/knockout-datatable.min.js.map b/knockout-datatable.min.js.map index aca9f23..27640ab 100644 --- a/knockout-datatable.min.js.map +++ b/knockout-datatable.min.js.map @@ -1 +1 @@ -{"version":3,"file":"knockout-datatable.min.js","sources":["knockout-datatable.js"],"names":["__bind","fn","me","apply","arguments","__indexOf","indexOf","item","i","l","this","length","DataTable","rows","options","getLimitedPages","getPages","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","alwaysMatch","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","observable","currentPageNumber","filter","extend","rateLimit","method","timeout","loading","observableArray","rowCount","page","pageNumber","pagesArr","rowIndex","Math","ceil","number","start","end","min","blanks","current","firstPage","lastPage","leftMargin","limit","pages","rightMargin","floor","slice","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","limitedPages","currentPage","pagedRows","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","status","JSON","parse","responseText","onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map","refreshData","toggleSort","field","nextPage","gotoPage","pageClass"],"mappings":"CAAA,WACE,GAAIA,GAAS,SAASC,EAAIC,GAAK,MAAO,YAAY,MAAOD,GAAGE,MAAMD,EAAIE,aACpEC,KAAeC,SAAW,SAASC,GAAQ,IAAK,GAAIC,GAAI,EAAGC,EAAIC,KAAKC,OAAYF,EAAJD,EAAOA,IAAO,GAAIA,IAAKE,OAAQA,KAAKF,KAAOD,EAAM,MAAOC,EAAK,OAAO,GAElJE,MAAKE,UAAY,WAmBf,QAASA,GAAUC,EAAMC,GACvBJ,KAAKK,gBAAkBf,EAAOU,KAAKK,gBAAiBL,MACpDA,KAAKM,SAAWhB,EAAOU,KAAKM,SAAUN,KACtC,IAAIO,EAuBJ,IAtBKH,IACGD,YAAgBK,OAIpBJ,MAHAA,EAAUD,EACVA,OAKJH,KAAKI,SACHK,WAAYL,EAAQK,YAAc,SAClCC,iBAAkBN,EAAQM,iBAC1BC,QAASP,EAAQO,SAAW,MAC5BC,UAAWR,EAAQQ,WAAa,OAChCC,QAAST,EAAQS,SAAW,GAC5BC,gBAAiBV,EAAQU,iBAAmB,GAC5CC,SAAUX,EAAQW,UAAY,OAC9BC,YAAaZ,EAAQY,cAAe,EACpCC,cAAeb,EAAQa,eAAiB,GACxCC,cAAed,EAAQc,eAAiB,GACxCC,aAAcf,EAAQe,cAAgB,IAExCnB,KAAKoB,mBACAb,EAAiBH,EAAQiB,uBAAyBd,EAAee,QAAS,CAC7E,IAAMf,EAAegB,OAAQhB,EAAeiB,OAC1C,KAAM,IAAIC,OAAM,gEAElBzB,MAAKI,QAAQsB,eAAiBnB,EAAegB,KAC7CvB,KAAKI,QAAQuB,gBAA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AUgH,SAAW,WAC7B,GAAIrG,EAEJ,OADAA,GAAOjD,KAAKwC,oBACRS,IAASjD,KAAKiE,QAAQhE,OACjBD,KAAKwC,kBAAkBS,EAAO,GADvC,QAKF/C,EAAUoC,UAAUiH,SAAW,SAAStG,GACtC,MAAO,UAAUuB,GACf,MAAO,YACL,MAAOA,GAAMhC,kBAAkBS,KAEhCjD,OAGLE,EAAUoC,UAAUkH,UAAY,SAASvG,GACvC,MAAOlB,GAAa,SAAUyC,GAC5B,MAAO,YACL,MAAIA,GAAMhC,sBAAwBS,EACzB,SADT,SAIDjD,QAGEE,OAIRsH,KAAKxH"} \ No newline at end of file +{"version":3,"file":"knockout-datatable.min.js","sources":["knockout-datatable.js"],"names":["__bind","fn","me","apply","arguments","__indexOf","indexOf","item","i","l","this","length","DataTable","rows","options","getLimitedPages","getPages","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","alwaysMatch","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","observable","currentPageNumber","filter","extend","rateLimit","method","timeout","loading","observableArray","rowCount","page","pageNumber","pagesArr","rowIndex","Math","ceil","number","start","end","min","blanks","current","firstPage","lastPage","leftMargin","limit","pages","rightMargin","floor","slice","filterTrigger","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","notify","triggerFilterCalculation","valueHasMutated","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","limitedPages","currentPage","pagedRows","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","status","JSON","parse","responseText","onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map","refreshData","toggleSort","field","nextPage","gotoPage","pageClass"],"mappings":"CAAA,WACE,GAAIA,GAAS,SAASC,EAAIC,GAAK,MAAO,YAAY,MAAOD,GAAGE,MAAMD,EAAIE,aACpEC,KAAeC,SAAW,SAASC,GAAQ,IAAK,GAAIC,GAAI,EAAGC,EAAIC,KAAKC,OAAYF,EAAJD,EAAOA,IAAO,GAAIA,IAAKE,OAAQA,KAAKF,KAAOD,EAAM,MAAOC,EAAK,OAAO,GAElJE,MAAKE,UAAY,WAmBf,QAASA,GAAUC,EAAMC,GACvBJ,KAAKK,gBAAkBf,EAAOU,KAAKK,gBAAiBL,MACpDA,KAAKM,SAAWhB,EAAOU,KAAKM,SAAUN,KACtC,IAAIO,EAuBJ,IAtBKH,IACGD,YAAgBK,OAIpBJ,MAHAA,EAAUD,EACVA,OAKJH,KAAKI,SACHK,WAAYL,EAAQK,YAAc,SAClCC,iBAAkBN,EAAQM,iBAC1BC,QAASP,EAAQO,SAAW,MAC5BC,UAAWR,EAAQQ,WAAa,OAChCC,QAAST,EAAQS,SAAW,GAC5BC,gBAAiBV,EAAQU,iBAAmB,GAC5CC,SAAUX,EAAQW,UAAY,OAC9BC,YAAaZ,EAAQY,cAAe,EACpCC,cAAeb,EAAQa,eAAiB,GACxCC,cAAed,EAAQc,eAAiB,GACxCC,aAAcf,EAAQe,cAAgB,IAExCnB,KAAKoB,mBACAb,EAAiBH,EAAQiB,uBAAyBd,EAAee,QAAS,CAC7E,IAAMf,EAAegB,OAAQhB,EAAeiB,OAC1C,KAAM,IAAIC,OAAM,gEAElBzB,MAAKI,QAAQsB,eAAiBnB,EAAegB,KAC7CvB,KAAKI,QAAQuB,gBAAkBpB,EAAeiB,OAC9CxB,KAAK4B,mCAEL5B,MAAK6B,6BAA6B1B,GApDtC,GAAI2B,GAAkBC,CAknBtB,OAhnBAA,GAAeC,GAAGD,cAAgBC,GAA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,UAAUoH,SAAW,WAC7B,GAAIzG,EAEJ,OADAA,GAAOjD,KAAKwC,oBACRS,IAASjD,KAAKiE,QAAQhE,OACjBD,KAAKwC,kBAAkBS,EAAO,GADvC,QAKF/C,EAAUoC,UAAUqH,SAAW,SAAS1G,GACtC,MAAO,UAAUwB,GACf,MAAO,YACL,MAAOA,GAAMjC,kBAAkBS,KAEhCjD,OAGLE,EAAUoC,UAAUsH,UAAY,SAAS3G,GACvC,MAAOlB,GAAa,SAAU0C,GAC5B,MAAO,YACL,MAAIA,GAAMjC,sBAAwBS,EACzB,SADT,SAIDjD,QAGEE,OAIR0H,KAAK5H"} \ No newline at end of file From 53038964e1f6297c5c10f935fe66f254924315cc Mon Sep 17 00:00:00 2001 From: Ohad Schneider Date: Sun, 28 Jun 2015 22:38:55 +0300 Subject: [PATCH 8/8] go back to page 1 when filter is triggered --- knockout-datatable.coffee | 1 + knockout-datatable.js | 3 ++- knockout-datatable.min.js | 2 +- knockout-datatable.min.js.map | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/knockout-datatable.coffee b/knockout-datatable.coffee index f70e0a9..a21a710 100644 --- a/knockout-datatable.coffee +++ b/knockout-datatable.coffee @@ -119,6 +119,7 @@ class @DataTable @triggerFilterCalculation = => filterTrigger.valueHasMutated() + @currentPageNumber 1 @filteredRows = pureComputed => filterTrigger() diff --git a/knockout-datatable.js b/knockout-datatable.js index ae58ae0..dd9494c 100644 --- a/knockout-datatable.js +++ b/knockout-datatable.js @@ -150,7 +150,8 @@ }); this.triggerFilterCalculation = (function(_this) { return function() { - return filterTrigger.valueHasMutated(); + filterTrigger.valueHasMutated(); + return _this.currentPageNumber(1); }; })(this); this.filteredRows = pureComputed((function(_this) { diff --git a/knockout-datatable.min.js b/knockout-datatable.min.js index fb00445..028aadf 100644 --- a/knockout-datatable.min.js +++ b/knockout-datatable.min.js @@ -1,2 +1,2 @@ -(function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};this.DataTable=function(){function c(b,c){this.getLimitedPages=a(this.getLimitedPages,this),this.getPages=a(this.getPages,this);var d;if(c||(b instanceof Array?c={}:(c=b,b=[])),this.options={recordWord:c.recordWord||"record",recordWordPlural:c.recordWordPlural,sortDir:c.sortDir||"asc",sortField:c.sortField||void 0,perPage:c.perPage||15,paginationLimit:c.paginationLimit||10,filterFn:c.filterFn||void 0,alwaysMatch:c.alwaysMatch||!1,unsortedClass:c.unsortedClass||"",descSortClass:c.descSortClass||"",ascSortClass:c.ascSortClass||""},this.initObservables(),(d=c.serverSidePagination)&&d.enabled){if(!d.path||!d.loader)throw new Error("`path` or `loader` missing from `serverSidePagination` object");this.options.paginationPath=d.path,this.options.resultHandlerFn=d.loader,this.initWithServerSidePagination()}else this.initWithClientSidePagination(b)}var d,e;return e=ko.pureComputed||ko.computed,d=function(a,b){return null==b?null==a:null!=a?"boolean"==typeof a?a===b:a.toString().toLowerCase().indexOf(b.toString().toLowerCase())>=0||a===b:!1},c.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable("").extend({rateLimit:{method:"notifyWhenChangesStop",timeout:400}}),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},c.prototype.getPages=function(a){var b,c,d,e,f;for(e=this.perPage(),f=0,c=1,d=new Array(Math.ceil(a/e));a>f;)b={number:c,start:f,end:Math.min(a-1,f+e-1)},b.blanks=new Array(d.length>1?e-(b.end-b.start+1):0),d[c-1]=b,c++,f+=e;return d},c.prototype.getLimitedPages=function(){var a,b,c,d,e,f,g;return f=this.pages(),a=this.currentPageNumber(),e=this.options.paginationLimit,f.length<=e?f:(d=Math.floor(e/2),b=a-Math.floor(d),1>b?f.slice(0,e):(g=e%2===0?d-1:d,c=a+g,c>f.length?f.slice(f.length-e,f.length):f.slice(b-1,c)))},c.prototype.initWithClientSidePagination=function(a){var c,f;return this.filtering=ko.observable(!1),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.rows(a),this.rowAttributeMap=e(function(b){return function(){var c,d,e;if(a=b.rows(),c={},a.length>0){e=a[0];for(d in e)e.hasOwnProperty(d)&&(c[d.toLowerCase()]=d)}return c}}(this)),c=ko.observable().extend({notify:"always"}),this.triggerFilterCalculation=function(){return function(){return c.valueHasMutated()}}(this),this.filteredRows=e(function(b){return function(){var d,e;return c(),b.filtering(!0),d=b.filter(),a=b.rows.slice(0),(b.options.alwaysMatch||""!==d)&&(e=b.filterFn(d),a=a.filter(e)),null!=b.sortField()&&""!==b.sortField()&&a.sort(function(a,c){var d,e;return d=ko.utils.unwrapObservable(a[b.sortField()]),e=ko.utils.unwrapObservable(c[b.sortField()]),"string"==typeof d&&(d=d.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),"asc"===b.sortDir()?e>d||""===d||null==d?-1:d>e||""===e||null==e?1:0:e>d||""===d||null==d?1:d>e||""===e||null==e?-1:0}),b.filtering(!1),a}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.filteredRows().length)}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages().length>0?a.pages()[a.currentPageNumber()-1]:{number:1,start:0,end:0,blanks:[]}}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.total=e(function(a){return function(){return a.filteredRows().length}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return b=a.from(),e=a.to(),f=a.total(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(a){return function(b){return a.rows.push(b)}}(this),this.removeRecord=function(a){return function(b){return a.rows.remove(b),0===a.pagedRows().length?a.prevPage():void 0}}(this),this.replaceRows=function(a){return function(b){return a.rows(b),a.currentPageNumber(1),a.filter(void 0)}}(this),f=function(a,b,c){var e,f;return function(){var a;a=[];for(e in c)f=c[e],a.push(f);return a}().some(function(c){return d(ko.isObservable(b[c])?b[c]():b[c],a)})},this.filterFn=this.options.filterFn||function(a){return function(c){var e,g,h;return h=[[],{}],e=h[0],g=h[1],c.split(" ").forEach(function(a){var b;return a.indexOf(":")>=0?(b=a.split(":"),g[b[0]]=function(){switch(b[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return b[1].toLowerCase()}}()):e.push(a)}),e=e.join(" "),function(c){var h,i,j;return h=function(){var a;a=[];for(i in g)j=g[i],a.push(function(a){return function(b,e){var f;return(f=a.rowAttributeMap()[b.toLowerCase()])?d(ko.isObservable(c[f])?c[f]():c[f],e):!1}}(this)(i,j));return a}.call(a),b.call(h,!1)<0&&(a.options.alwaysMatch||""!==e?null!=c.match?c.match(e):f(e,c,a.rowAttributeMap()):!0)}}}(this)},c.prototype.initWithServerSidePagination=function(){var a,b;return b=function(a){return function(b,c){var d,e,f,g;return f=""+a.options.paginationPath+"?"+function(){var a;a=[];for(d in b)g=b[d],a.push(""+encodeURIComponent(d)+"="+encodeURIComponent(g));return a}().join("&"),e=new XMLHttpRequest,e.open("GET",f,!0),e.setRequestHeader("Content-Type","application/json"),e.onload=function(){return e.status>=200&&e.status<400?c(null,JSON.parse(e.responseText)):c(new Error("Error communicating with server"))},e.onerror=function(){return c(new Error("Error communicating with server"))},e.send()}}(this),a=function(a,b,c,d,e){var f;return f={perPage:a,page:b},null!=c&&""!==c&&(f.filter=c),null!=d&&""!==d&&null!=e&&""!==e&&(f.sortDir=d,f.sortBy=e),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),ko.computed(function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.numFilteredRows())}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages()[a.currentPageNumber()-1]}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return f=a.numFilteredRows(),b=a.from(),e=a.to(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled")},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled")},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled")},this.refreshData=function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)},c.prototype.toggleSort=function(a){return function(b){return function(){return b.currentPageNumber(1),b.sortField()===a?b.sortDir("asc"===b.sortDir()?"desc":"asc"):(b.sortDir("asc"),b.sortField(a))}}(this)},c.prototype.prevPage=function(){var a;return a=this.currentPageNumber(),1!==a?this.currentPageNumber(a-1):void 0},c.prototype.nextPage=function(){var a;return a=this.currentPageNumber(),a!==this.pages().length?this.currentPageNumber(a+1):void 0},c.prototype.gotoPage=function(a){return function(b){return function(){return b.currentPageNumber(a)}}(this)},c.prototype.pageClass=function(a){return e(function(b){return function(){return b.currentPageNumber()===a?"active":void 0}}(this))},c}()}).call(this); +(function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};this.DataTable=function(){function c(b,c){this.getLimitedPages=a(this.getLimitedPages,this),this.getPages=a(this.getPages,this);var d;if(c||(b instanceof Array?c={}:(c=b,b=[])),this.options={recordWord:c.recordWord||"record",recordWordPlural:c.recordWordPlural,sortDir:c.sortDir||"asc",sortField:c.sortField||void 0,perPage:c.perPage||15,paginationLimit:c.paginationLimit||10,filterFn:c.filterFn||void 0,alwaysMatch:c.alwaysMatch||!1,unsortedClass:c.unsortedClass||"",descSortClass:c.descSortClass||"",ascSortClass:c.ascSortClass||""},this.initObservables(),(d=c.serverSidePagination)&&d.enabled){if(!d.path||!d.loader)throw new Error("`path` or `loader` missing from `serverSidePagination` object");this.options.paginationPath=d.path,this.options.resultHandlerFn=d.loader,this.initWithServerSidePagination()}else this.initWithClientSidePagination(b)}var d,e;return e=ko.pureComputed||ko.computed,d=function(a,b){return null==b?null==a:null!=a?"boolean"==typeof a?a===b:a.toString().toLowerCase().indexOf(b.toString().toLowerCase())>=0||a===b:!1},c.prototype.initObservables=function(){return this.sortDir=ko.observable(this.options.sortDir),this.sortField=ko.observable(this.options.sortField),this.perPage=ko.observable(this.options.perPage),this.currentPageNumber=ko.observable(1),this.filter=ko.observable("").extend({rateLimit:{method:"notifyWhenChangesStop",timeout:400}}),this.loading=ko.observable(!1),this.rows=ko.observableArray([])},c.prototype.getPages=function(a){var b,c,d,e,f;for(e=this.perPage(),f=0,c=1,d=new Array(Math.ceil(a/e));a>f;)b={number:c,start:f,end:Math.min(a-1,f+e-1)},b.blanks=new Array(d.length>1?e-(b.end-b.start+1):0),d[c-1]=b,c++,f+=e;return d},c.prototype.getLimitedPages=function(){var a,b,c,d,e,f,g;return f=this.pages(),a=this.currentPageNumber(),e=this.options.paginationLimit,f.length<=e?f:(d=Math.floor(e/2),b=a-Math.floor(d),1>b?f.slice(0,e):(g=e%2===0?d-1:d,c=a+g,c>f.length?f.slice(f.length-e,f.length):f.slice(b-1,c)))},c.prototype.initWithClientSidePagination=function(a){var c,f;return this.filtering=ko.observable(!1),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.rows(a),this.rowAttributeMap=e(function(b){return function(){var c,d,e;if(a=b.rows(),c={},a.length>0){e=a[0];for(d in e)e.hasOwnProperty(d)&&(c[d.toLowerCase()]=d)}return c}}(this)),c=ko.observable().extend({notify:"always"}),this.triggerFilterCalculation=function(a){return function(){return c.valueHasMutated(),a.currentPageNumber(1)}}(this),this.filteredRows=e(function(b){return function(){var d,e;return c(),b.filtering(!0),d=b.filter(),a=b.rows.slice(0),(b.options.alwaysMatch||""!==d)&&(e=b.filterFn(d),a=a.filter(e)),null!=b.sortField()&&""!==b.sortField()&&a.sort(function(a,c){var d,e;return d=ko.utils.unwrapObservable(a[b.sortField()]),e=ko.utils.unwrapObservable(c[b.sortField()]),"string"==typeof d&&(d=d.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),"asc"===b.sortDir()?e>d||""===d||null==d?-1:d>e||""===e||null==e?1:0:e>d||""===d||null==d?1:d>e||""===e||null==e?-1:0}),b.filtering(!1),a}}(this)).extend({rateLimit:50,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.filteredRows().length)}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages().length>0?a.pages()[a.currentPageNumber()-1]:{number:1,start:0,end:0,blanks:[]}}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.total=e(function(a){return function(){return a.filteredRows().length}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return b=a.from(),e=a.to(),f=a.total(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(a){return function(b){return a.rows.push(b)}}(this),this.removeRecord=function(a){return function(b){return a.rows.remove(b),0===a.pagedRows().length?a.prevPage():void 0}}(this),this.replaceRows=function(a){return function(b){return a.rows(b),a.currentPageNumber(1),a.filter(void 0)}}(this),f=function(a,b,c){var e,f;return function(){var a;a=[];for(e in c)f=c[e],a.push(f);return a}().some(function(c){return d(ko.isObservable(b[c])?b[c]():b[c],a)})},this.filterFn=this.options.filterFn||function(a){return function(c){var e,g,h;return h=[[],{}],e=h[0],g=h[1],c.split(" ").forEach(function(a){var b;return a.indexOf(":")>=0?(b=a.split(":"),g[b[0]]=function(){switch(b[1].toLowerCase()){case"yes":case"true":return!0;case"no":case"false":return!1;case"blank":case"none":case"null":case"undefined":return void 0;default:return b[1].toLowerCase()}}()):e.push(a)}),e=e.join(" "),function(c){var h,i,j;return h=function(){var a;a=[];for(i in g)j=g[i],a.push(function(a){return function(b,e){var f;return(f=a.rowAttributeMap()[b.toLowerCase()])?d(ko.isObservable(c[f])?c[f]():c[f],e):!1}}(this)(i,j));return a}.call(a),b.call(h,!1)<0&&(a.options.alwaysMatch||""!==e?null!=c.match?c.match(e):f(e,c,a.rowAttributeMap()):!0)}}}(this)},c.prototype.initWithServerSidePagination=function(){var a,b;return b=function(a){return function(b,c){var d,e,f,g;return f=""+a.options.paginationPath+"?"+function(){var a;a=[];for(d in b)g=b[d],a.push(""+encodeURIComponent(d)+"="+encodeURIComponent(g));return a}().join("&"),e=new XMLHttpRequest,e.open("GET",f,!0),e.setRequestHeader("Content-Type","application/json"),e.onload=function(){return e.status>=200&&e.status<400?c(null,JSON.parse(e.responseText)):c(new Error("Error communicating with server"))},e.onerror=function(){return c(new Error("Error communicating with server"))},e.send()}}(this),a=function(a,b,c,d,e){var f;return f={perPage:a,page:b},null!=c&&""!==c&&(f.filter=c),null!=d&&""!==d&&null!=e&&""!==e&&(f.sortDir=d,f.sortBy=e),f},this.filtering=ko.observable(!1),this.pagedRows=ko.observableArray([]),this.numFilteredRows=ko.observable(0),this.filter.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),this.perPage.subscribe(function(a){return function(){return a.currentPageNumber(1)}}(this)),ko.computed(function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)).extend({rateLimit:500,method:"notifyWhenChangesStop"}),this.pages=e(function(a){return function(){return a.getPages(a.numFilteredRows())}}(this)),this.limitedPages=e(function(a){return function(){return a.getLimitedPages()}}(this)),this.currentPage=e(function(a){return function(){return a.pages()[a.currentPageNumber()-1]}}(this)),this.pagedRows=e(function(a){return function(){return a.filteredRows().slice(a.currentPage().start,a.currentPage().end+1)}}(this)),this.leftPagerClass=e(function(a){return function(){return 1===a.currentPageNumber()?"disabled":void 0}}(this)),this.rightPagerClass=e(function(a){return function(){return a.currentPageNumber()===a.pages().length?"disabled":void 0}}(this)),this.from=e(function(a){return function(){return a.currentPage().start+1}}(this)),this.to=e(function(a){return function(){return a.currentPage().end+1}}(this)),this.recordsText=e(function(a){return function(){var b,c,d,e,f;return f=a.numFilteredRows(),b=a.from(),e=a.to(),c=a.options.recordWord,d=a.options.recordWordPlural||c+"s",a.pages().length>1?""+b+" to "+e+" of "+f+" "+d:""+f+" "+(f>1||0===f?d:c)}}(this)),this.showNoData=e(function(a){return function(){return 0===a.pagedRows().length&&!a.loading()}}(this)),this.showLoading=e(function(a){return function(){return a.loading()}}(this)),this.sortClass=function(a){return function(b){return e(function(){return a.sortField()===b?"sorted "+("asc"===a.sortDir()?a.options.ascSortClass:a.options.descSortClass):a.options.unsortedClass})}}(this),this.addRecord=function(){throw new Error("#addRecord() not applicable with serverSidePagination enabled")},this.removeRecord=function(){throw new Error("#removeRecord() not applicable with serverSidePagination enabled")},this.replaceRows=function(){throw new Error("#replaceRows() not applicable with serverSidePagination enabled")},this.refreshData=function(c){return function(){var d;return c.loading(!0),c.filtering(!0),d=a(c.perPage(),c.currentPageNumber(),c.filter(),c.sortDir(),c.sortField()),b(d,function(a,b){var d,e;return c.loading(!1),c.filtering(!1),a?console.log(a):(e=b.total,d=b.results,c.numFilteredRows(e),c.pagedRows(d.map(c.options.resultHandlerFn)))})}}(this)},c.prototype.toggleSort=function(a){return function(b){return function(){return b.currentPageNumber(1),b.sortField()===a?b.sortDir("asc"===b.sortDir()?"desc":"asc"):(b.sortDir("asc"),b.sortField(a))}}(this)},c.prototype.prevPage=function(){var a;return a=this.currentPageNumber(),1!==a?this.currentPageNumber(a-1):void 0},c.prototype.nextPage=function(){var a;return a=this.currentPageNumber(),a!==this.pages().length?this.currentPageNumber(a+1):void 0},c.prototype.gotoPage=function(a){return function(b){return function(){return b.currentPageNumber(a)}}(this)},c.prototype.pageClass=function(a){return e(function(b){return function(){return b.currentPageNumber()===a?"active":void 0}}(this))},c}()}).call(this); //# sourceMappingURL=knockout-datatable.min.js.map \ No newline at end of file diff --git a/knockout-datatable.min.js.map b/knockout-datatable.min.js.map index 27640ab..326deba 100644 --- a/knockout-datatable.min.js.map +++ b/knockout-datatable.min.js.map @@ -1 +1 @@ -{"version":3,"file":"knockout-datatable.min.js","sources":["knockout-datatable.js"],"names":["__bind","fn","me","apply","arguments","__indexOf","indexOf","item","i","l","this","length","DataTable","rows","options","getLimitedPages","getPages","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","alwaysMatch","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","observable","currentPageNumber","filter","extend","rateLimit","method","timeout","loading","observableArray","rowCount","page","pageNumber","pagesArr","rowIndex","Math","ceil","number","start","end","min","blanks","current","firstPage","lastPage","leftMargin","limit","pages","rightMargin","floor","slice","filterTrigger","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","notify","triggerFilterCalculation","valueHasMutated","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","limitedPages","currentPage","pagedRows","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","status","JSON","parse","responseText","onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map","refreshData","toggleSort","field","nextPage","gotoPage","pageClass"],"mappings":"CAAA,WACE,GAAIA,GAAS,SAASC,EAAIC,GAAK,MAAO,YAAY,MAAOD,GAAGE,MAAMD,EAAIE,aACpEC,KAAeC,SAAW,SAASC,GAAQ,IAAK,GAAIC,GAAI,EAAGC,EAAIC,KAAKC,OAAYF,EAAJD,EAAOA,IAAO,GAAIA,IAAKE,OAAQA,KAAKF,KAAOD,EAAM,MAAOC,EAAK,OAAO,GAElJE,MAAKE,UAAY,WAmBf,QAASA,GAAUC,EAAMC,GACvBJ,KAAKK,gBAAkBf,EAAOU,KAAKK,gBAAiBL,MACpDA,KAAKM,SAAWhB,EAAOU,KAAKM,SAAUN,KACtC,IAAIO,EAuBJ,IAtBKH,IACGD,YAAgBK,OAIpBJ,MAHAA,EAAUD,EACVA,OAKJH,KAAKI,SACHK,WAAYL,EAAQK,YAAc,SAClCC,iBAAkBN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D,CAGb,OAFAtB,GAAM3B,SAAQ,GACd2B,EAAMF,WAAU,GACZ0E,EACKG,QAAQC,IAAIJ,IAErBlD,EAAQmD,EAASnD,MAAOoD,EAAUD,EAASC,QAC3C1E,EAAMuE,gBAAgBjD,GACftB,EAAMmB,UAAUuD,EAAQG,IAAI7E,EAAMrE,QAAQuB,uBAGpD3B,OAGLE,EAAUoC,UAAUkH,WAAa,SAASC,GACxC,MAAO,UAAUhF,GACf,MAAO,YAEL,MADAA,GAAMjC,kBAAkB,GACpBiC,EAAM7D,cAAgB6I,EACjBhF,EAAM9D,QAA4B,QAApB8D,EAAM9D,UAAsB,OAAS,QAE1D8D,EAAM9D,QAAQ,OACP8D,EAAM7D,UAAU6I,MAG1BzJ,OAGLE,EAAUoC,UAAUsE,SAAW,WAC7B,GAAI3D,EAEJ,OADAA,GAAOjD,KAAKwC,oBACC,IAATS,EACKjD,KAAKwC,kBAAkBS,EAAO,GADvC,QAKF/C,EAAUoC,UAAUoH,SAAW,WAC7B,GAAIzG,EAEJ,OADAA,GAAOjD,KAAKwC,oBACRS,IAASjD,KAAKiE,QAAQhE,OACjBD,KAAKwC,kBAAkBS,EAAO,GADvC,QAKF/C,EAAUoC,UAAUqH,SAAW,SAAS1G,GACtC,MAAO,UAAUwB,GACf,MAAO,YACL,MAAOA,GAAMjC,kBAAkBS,KAEhCjD,OAGLE,EAAUoC,UAAUsH,UAAY,SAAS3G,GACvC,MAAOlB,GAAa,SAAU0C,GAC5B,MAAO,YACL,MAAIA,GAAMjC,sBAAwBS,EACzB,SADT,SAIDjD,QAGEE,OAIR0H,KAAK5H"} \ No newline at end of file +{"version":3,"file":"knockout-datatable.min.js","sources":["knockout-datatable.js"],"names":["__bind","fn","me","apply","arguments","__indexOf","indexOf","item","i","l","this","length","DataTable","rows","options","getLimitedPages","getPages","serverSideOpts","Array","recordWord","recordWordPlural","sortDir","sortField","perPage","paginationLimit","filterFn","alwaysMatch","unsortedClass","descSortClass","ascSortClass","initObservables","serverSidePagination","enabled","path","loader","Error","paginationPath","resultHandlerFn","initWithServerSidePagination","initWithClientSidePagination","primitiveCompare","pureComputed","ko","computed","item1","item2","toString","toLowerCase","prototype","observable","currentPageNumber","filter","extend","rateLimit","method","timeout","loading","observableArray","rowCount","page","pageNumber","pagesArr","rowIndex","Math","ceil","number","start","end","min","blanks","current","firstPage","lastPage","leftMargin","limit","pages","rightMargin","floor","slice","filterTrigger","_defaultMatch","filtering","subscribe","_this","rowAttributeMap","attrMap","key","row","hasOwnProperty","notify","triggerFilterCalculation","valueHasMutated","filteredRows","sort","a","b","aVal","bVal","utils","unwrapObservable","limitedPages","currentPage","pagedRows","leftPagerClass","rightPagerClass","total","from","to","recordsText","showNoData","showLoading","sortClass","column","addRecord","record","push","removeRecord","remove","prevPage","replaceRows","val","_results","some","isObservable","filterVar","specials","_ref","split","forEach","word","words","join","conditionals","rowAttr","call","match","_gatherData","_getDataFromServer","data","cb","req","url","encodeURIComponent","XMLHttpRequest","open","setRequestHeader","onload","status","JSON","parse","responseText","onerror","send","sortBy","numFilteredRows","err","response","results","console","log","map","refreshData","toggleSort","field","nextPage","gotoPage","pageClass"],"mappings":"CAAA,WACE,GAAIA,GAAS,SAASC,EAAIC,GAAK,MAAO,YAAY,MAAOD,GAAGE,MAAMD,EAAIE,aACpEC,KAAeC,SAAW,SAASC,GAAQ,IAAK,GAAIC,GAAI,EAAGC,EAAIC,KAAKC,OAAYF,EAAJD,EAAOA,IAAO,GAAIA,IAAKE,OAAQA,KAAKF,KAAOD,EAAM,MAAOC,EAAK,OAAO,GAElJE,MAAKE,UAAY,WAmBf,QAASA,GAAUC,EAAMC,GACvBJ,KAAKK,gBAAkBf,EAAOU,KAAKK,gBAAiBL,MACpDA,KAAKM,SAAWhB,EAAOU,KAAKM,SAAUN,KACtC,IAAIO,EAuBJ,IAtBKH,IACGD,YAAgBK,OAIpBJ,MAHAA,EAAUD,EACVA,OAKJH,KAAKI,SACHK,WAAYL,EAAQK,YAAc,SAClCC,iB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