From c92584483af2e21799b9d90594920dc6002a5cb5 Mon Sep 17 00:00:00 2001 From: Michael Szul Date: Tue, 27 Mar 2018 15:28:28 -0400 Subject: [PATCH] Removed form loading of default list data --- bower.json | 2 +- package.json | 2 +- src/metron.forms.ts | 2 +- src/metron.lists.ts | 1 + src/metron.routing.ts | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bower.json b/bower.json index 9ad17ab..d3db2cc 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "metron", - "version": "2.8.3", + "version": "2.8.4", "description": "A lightweight library and front-end framework utilizing data attributes", "main": "dist/gen/metron.js", "authors": [ diff --git a/package.json b/package.json index 191ad84..a4ea19b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metronical.metron", - "version": "2.8.3", + "version": "2.8.4", "description": "A lightweight library and front-end framework utilizing data attributes", "main": "dist/gen/metron.js", "homepage": "https://github.com/metronical/metron", diff --git a/src/metron.forms.ts b/src/metron.forms.ts index 8e56445..2431fc4 100644 --- a/src/metron.forms.ts +++ b/src/metron.forms.ts @@ -63,7 +63,7 @@ namespace metron { defaults = metron.tools.formatOptions(qs, metron.OptionTypes.QUERYSTRING); } if (metron.globals.firstLoad) { - parameters = metron.routing.getRouteUrl(); + parameters = metron.routing.getRouteUrl({"PageSize": 1, "PageIndex": 1, "_SortOrder": 1, "_SortDirection": 1}); ///This should send null values or by removed by default. } self.loadForm(parameters, defaults); }); diff --git a/src/metron.lists.ts b/src/metron.lists.ts index 7b2e124..4b7d379 100644 --- a/src/metron.lists.ts +++ b/src/metron.lists.ts @@ -450,6 +450,7 @@ namespace metron { } let hash = metron.routing.getRouteUrl(self._filters); if (hash != null) { + /* If getRouteUrl() has the filters set, then the below items should never be in the hash. Might be able to delete this. */ self.pageSize = (hash["PageSize"] != null) ? hash["PageSize"] : self.pageSize; self.currentPageIndex = (hash["PageIndex"] != null) ? hash["PageIndex"] : self.currentPageIndex; self.sortOrder = (hash["_SortOrder"] != null) ? hash["_SortOrder"] : self.sortOrder; diff --git a/src/metron.routing.ts b/src/metron.routing.ts index f1c049f..47d9a4a 100644 --- a/src/metron.routing.ts +++ b/src/metron.routing.ts @@ -48,7 +48,7 @@ namespace metron { if (filters != null) { for (let h in result) { if (result.hasOwnProperty(h)) { - if (filters[h] != null) { + if (filters[h] != null) { //This should be checking for undefined. delete result[h]; } }