-
Notifications
You must be signed in to change notification settings - Fork 134
Filters
rondale-sc edited this page Apr 11, 2012
·
2 revisions
// From here on I'll be using the data from the spec for all examples
// before filters have been run pivot.data().raw will contain the raw data
// and pivot.data().all will be empty []
pivot.data().all
//=> []
pivot.data().raw
//=> [Object, Object, Object, Object, Object, Object]
pivot.data().all()
//=> []
pivot.filters().set({last_name: 'Jackson'});
pivot.filters().apply();
//=> [Object, Object, Object]
As you can see once the filter was applied the fields were filtered accordingly. Only objects with last_name of 'Jackson' remain in pivot.data().all
// Set pre-existing filters
pivot.filters().set({last_name: 'Jackson'});
pivot.filters().apply();
//=> [Object, Object, Object]
// Further restrict the data
pivot.filters().add({first_name: 'Jon'});
//=> [Object]