smebberson/linz — pull request #15 by sandytrinh (2014-05-16 04:54:24+00:00)
Title: Added filtering feature to formtool

This PR will be use for adding filtering functions to formtool using the following DSL:
```
grid: {
filters: {
businessName: {
label: 'Business name',
filter: linz.formtools.filters.default
},
code: {
// custom filter
filter: {
renderer: function customRenderer (fieldName, callback) {
return callback(null,'');
},
filter: function customFilterResult (fieldName, form, callback) {
return callback(null,{ firstName: form.test1, lastName: form.test2});
}
}
},
dateCreated: {
label: 'Date created',
filter: linz.formtools.filters.date
},
dateModified: {
label: 'Date modified',
filter: linz.formtools.filters.dateRange
},
bActive: {
label: 'Is active?',
filter: linz.formtools.filters.checkbox
}
}
}
```
### Where is this at:

First commit added support for the proposed DSL above and integrated into formtool plugin and also included unit tests for each of the filter provided by Linz.

### Remaining tasks:
- [ ] Add unit tests for each of the filter function provided by Linz. e.g. linz.formtool.filters.default.filter
- [ ] Update modelIndex middleware to process the filter object return from (e.g. linz.formtool.filters.default.filter) and allowing OR conditions for multiple filtering on the same field.