|
1 | 1 | /* |
2 | 2 | * filter.js |
3 | | - * 2.0.0 (2015-08-04) |
| 3 | + * 2.1.0 (2015-08-06) |
4 | 4 | * |
5 | 5 | * Released under the MIT license |
6 | 6 | * http://opensource.org/licenses/MIT |
|
13 | 13 |
|
14 | 14 | /* |
15 | 15 | * JsonQuery |
16 | | - * 0.0.2 (2015-05-20) |
| 16 | + * 0.0.2 (2015-08-06) |
17 | 17 | * |
18 | 18 | * Released under the MIT license |
19 | 19 | * http://opensource.org/licenses/MIT |
|
83 | 83 | this.lng = opts.longitude || Config.longitude; |
84 | 84 | this.id = opts.id; |
85 | 85 |
|
86 | | - if(this.records.length){ |
| 86 | + if(opts.schema){ |
| 87 | + this.schema = opts.schema; |
| 88 | + } |
| 89 | + |
| 90 | + if(this.records.length && !this.schema){ |
87 | 91 | initSchema(this, records[0], opts.schema); |
88 | 92 | } |
89 | 93 | }; |
|
1162 | 1166 | } |
1163 | 1167 |
|
1164 | 1168 | this.show(this.last_result); |
1165 | | - this.execCallback('afterFilter', this.last_result, JsonQuery.blankClone(this.last_result, this.Model)); |
1166 | 1169 | this.renderPagination(this.last_result.length); |
| 1170 | + this.execCallback('afterFilter', this.last_result, JsonQuery.blankClone(this.Model, this.last_result)); |
1167 | 1171 |
|
1168 | 1172 | return query; |
1169 | 1173 | }; |
|
1280 | 1284 |
|
1281 | 1285 | result = this.search(this.search_text, records || this.lastResult()); |
1282 | 1286 |
|
| 1287 | + this.search_result = result; |
1283 | 1288 | this.show(result); |
1284 | 1289 | this.renderPagination(result.length); |
1285 | | - this.execCallback('afterFilter', result); |
1286 | | - this.search_result = result; |
| 1290 | + this.execCallback('afterFilter', result, JsonQuery.blankClone(this.Model, result)); |
1287 | 1291 |
|
1288 | 1292 | return true; |
1289 | 1293 | }; |
|
1430 | 1434 |
|
1431 | 1435 |
|
1432 | 1436 |
|
1433 | | - |
1434 | | - |
1435 | 1437 | var Paginator = function(recordsCount, opts, onPagination) { |
1436 | 1438 | var paginationView; |
1437 | 1439 |
|
|
1614 | 1616 | }; |
1615 | 1617 |
|
1616 | 1618 | FilterJS.list = list; |
| 1619 | + FilterJS.templateBuilder = templateBuilder; |
1617 | 1620 |
|
1618 | 1621 | window.FilterJS = FilterJS; |
1619 | 1622 |
|
|
0 commit comments