Sometimes, you only need a specific subset of data from your Store. Your Store contains a complete dataset (for caching and easy retrieval), but you need it filtered to a specific set of Records. As an example, the cfdirectory
tag we used in our ColdFusion server-side call can return an entire directory listing, including all subdirectories. After retrieving the data, it may be that we only need the names of the files within the startPath
that we posted. For this, we can filter our client-side cached dataset to get only the Records of type, File:
ourStore.filter('TYPE','File',false,false);
This filters our dataset using the TYPE
field. The dataset will now only contain Records that have a TYPE
field, with a value of File
(matched from the beginning, and case-insensitive).
After working with our filtered dataset, there will come a time when we want our original dataset back. When we filtered the dataset, the other Records didn&apos...