From 6aba7f592c8451bae3a6c7e4ae1456c9522c6f17 Mon Sep 17 00:00:00 2001 From: sacquet49 Date: Wed, 15 Feb 2017 19:22:34 +0100 Subject: [PATCH 1/2] public.js I have, add parameters current and sortDictionary, i have fixed their by values defaut to : current = 1 and sortDictionary= {} . --- src/public.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/public.js b/src/public.js index 16c5c44..5fc84bb 100644 --- a/src/public.js +++ b/src/public.js @@ -18,7 +18,7 @@ var Grid = function(element, options) // overrides rowCount explicitly because deep copy ($.extend) leads to strange behaviour var rowCount = this.options.rowCount = this.element.data().rowCount || options.rowCount || this.options.rowCount; this.columns = []; - this.current = 1; + this.current = = this.options.current; this.currentRows = []; this.identifier = null; // The first column ID that is marked as identifier this.selection = false; @@ -27,7 +27,7 @@ var Grid = function(element, options) this.rows = []; this.searchPhrase = ""; this.selectedRows = []; - this.sortDictionary = {}; + this.sortDictionary = this.options.sortDictionary; this.total = 0; this.totalPages = 0; this.cachedParams = { @@ -60,6 +60,8 @@ Grid.defaults = { padding: 2, // page padding (pagination) columnSelection: true, rowCount: [10, 25, 50, -1], // rows per page int or array of int (-1 represents "All") + current: 1, // Current page 1 + sortDictionary: {}, // No sort option /** * Enables row selection (to enable multi selection see also `multiSelect`). Default value is `false`. @@ -853,4 +855,4 @@ Grid.prototype.getTotalPageCount = function() Grid.prototype.getTotalRowCount = function() { return this.total; -}; \ No newline at end of file +}; From 09c170cf98e3e68bab9e99b429ad526b74ee6cb6 Mon Sep 17 00:00:00 2001 From: sacquet49 Date: Wed, 15 Feb 2017 19:41:09 +0100 Subject: [PATCH 2/2] Update public.js --- src/public.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public.js b/src/public.js index 5fc84bb..546d550 100644 --- a/src/public.js +++ b/src/public.js @@ -18,7 +18,7 @@ var Grid = function(element, options) // overrides rowCount explicitly because deep copy ($.extend) leads to strange behaviour var rowCount = this.options.rowCount = this.element.data().rowCount || options.rowCount || this.options.rowCount; this.columns = []; - this.current = = this.options.current; + this.current = this.options.current; this.currentRows = []; this.identifier = null; // The first column ID that is marked as identifier this.selection = false;