Extract pagination values from the query string.
Showing
1 changed file
with
6 additions
and
0 deletions
... | @@ -59,6 +59,7 @@ define(function(require) { | ... | @@ -59,6 +59,7 @@ define(function(require) { |
59 | 59 | ||
60 | if (parts) { | 60 | if (parts) { |
61 | var formNameMap = this.get('formNameMap'); | 61 | var formNameMap = this.get('formNameMap'); |
62 | var pagination = {}; | ||
62 | var keyValueParts = parts[1].split('&'); | 63 | var keyValueParts = parts[1].split('&'); |
63 | _.each(keyValueParts, function(keyValuePart, i) { | 64 | _.each(keyValueParts, function(keyValuePart, i) { |
64 | var keyFieldValue = keyValuePart.match(/^([^.]+)(?:\.([^.]+))?=(.*)$/); | 65 | var keyFieldValue = keyValuePart.match(/^([^.]+)(?:\.([^.]+))?=(.*)$/); |
... | @@ -90,9 +91,14 @@ define(function(require) { | ... | @@ -90,9 +91,14 @@ define(function(require) { |
90 | item.set('checked', true, skipOptions); | 91 | item.set('checked', true, skipOptions); |
91 | } | 92 | } |
92 | } | 93 | } |
94 | } else if (key === 'p') { | ||
95 | pagination['currentPage'] = parseInt(value); | ||
96 | } else if (key === 'sz') { | ||
97 | pagination['pageSize'] = parseInt(value); | ||
93 | } | 98 | } |
94 | } | 99 | } |
95 | }, this); | 100 | }, this); |
101 | this.set(pagination, skipOptions); | ||
96 | } | 102 | } |
97 | }, | 103 | }, |
98 | initialize: function(data, options) { | 104 | initialize: function(data, options) { | ... | ... |
-
Please register or sign in to post a comment