I'm using the Backgrid filter extension http://backgridjs.com/ref/extensions/filter.html and I'm wondering how I can
- Set the search element to a checkbox instead of a search box
- Chain a series of query parameters ala ?q='djfsl'&q2='jdfskf'
So far I have this:
var customFilter = Backgrid.Extension.ServerSideFilter.extend({
selectOptions: [{
label: 'Review', value: 0
}],
// override the makeMatcher function to turn the query into an int
makeMatcher: function (query) {
var intQuery = parseInt(query, 10)
return intQuery
}
})
var serverSideFilter = new customFilter({
collection: recipes,
placeholder: 'Search term',
name: ['tags']
})
recipesListLayout.recipesRegion.show(grid)
// this renders a SearchBox by default - want to know how to create checkboxes instead?
recipesListLayout.panelRegion.$el.append(serverSideFilter.render().el)
However, what I want to achieve is something more along the lines of this: http://www.codegur.net/20767244/add-backgrid-filter-for-each-column
Or more precisely this:
where multiple checkboxes can be selected and the query created would be something like: ?review=0&featured=1
With the code I have at the moment I seem to be only able to set one query parameter which looks like ?tags=0
where tags has been set as the name in my customFilter.