Skip to content

Instantly share code, notes, and snippets.

@lholmquist
Created September 24, 2012 20:32
Show Gist options
  • Save lholmquist/3778193 to your computer and use it in GitHub Desktop.
Save lholmquist/3778193 to your computer and use it in GitHub Desktop.
Datamanger Memory Adapter
//When a field has multiple values, the filter method of the Memory Data Adapter won't work
//Here is some example data
userValve.save([
{
id: 12351,
fname: "Luke",
lname: "Public",
dept: [ "Accounting", "IT" ]
},
{
id: 12352,
fname: "Bob",
lname: "Private",
dept: [ "Finance", "IT" ]
},
{
id: 12353,
fname: "Joe Bob",
lname: "Public",
dept: [ "Accounting", "Other" ]
}
], true );
var filtered = userValve.filter( { dept: "IT" } ); ==> will return an empty array
//The dept field is how the tags are stored in the todo app on the tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment