Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 = {
Expand Down Expand Up @@ -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`.
Expand Down Expand Up @@ -853,4 +855,4 @@ Grid.prototype.getTotalPageCount = function()
Grid.prototype.getTotalRowCount = function()
{
return this.total;
};
};