There are various types of stores in Dojo and the purpose of these stores is to separate the data from UI components. This means that you can use the same store with multiple widgets. Since the store contains data, we can perform a search on the store as shown below:

store.fetch({query:{id: '*'}, onComplete: function (items) {}
});

After invoking the fetch on store, we can get hold of items that were searched by using various callback methods. Let us first discuss the various parts of above statement.

Search query params

While invoking the fetch method, we pass the query params to it in the form of id:(*). This means that I am looking for all items present in the store and id is a attribute of store. We can also replace id with any other attribute of store (say name). Now if I specify a value instead of * then I shall get results after searching for this value in the store for this property. Let us modify the above code sample with:

store.fetch({query:{id: 'a'}, onComplete: function (items) {}
});

Now we shall get only those items which have ‘a’ as value of ‘id’ property. We can also perform a search based on multiple store properties like:

store.fetch({query:{id: 'a',name: 'b'}, onComplete: function (items) {}
});

Here we are asking for items which have ‘id’ as ‘a’ and ‘name’ as ‘b’. One can access the items searched on the store by using callback methods.

Search Callback methods

There are various call back methods and we shall discuss two out of them. First thing to note about call back methods is that you always get a reference to the items returned after performing search. Let us now discuss ‘onComplete’ and ‘onItem’ call back methods:

onComplete : onComplete is called every time the search is complete. It is guaranteed to be called after search. The items are passed to it are the results of search query.
onItem : This call back method is invoked only if an item has been found by search operation. The argument to this method is also search results.

It is important to note that irrespective of call back being used, we can check if an item has been found or not by placing a check on item.length. If the length of items array is 0 then it means that no results were found.

Performance

You should try to utilize the results of a search as much as possible. Every time you perform a search there is some work to be done by the client browser. Say if you perform a search operation on click of combobox then there will be some delay in options being displayed for the combobox due to the processing involved.
But again if you have update the store after last search operation, better perform a fresh search on store attributes.

Search store items in dojo admin Dojo
There are various types of stores in Dojo and the purpose of these stores is to separate the data from UI components. This means that you can use the same store with multiple widgets. Since the store contains data, we can perform a search on the store as...
<p>There are various types of stores in Dojo and the purpose of these stores is to separate the data from UI components. This means that you can use the same store with multiple widgets. Since the store contains data, we can perform a search on the store as shown below:</p> 1 <p>After invoking the fetch on store, we can get hold of items that were searched by using various callback methods. Let us first discuss the various parts of above statement.</p> <h2>Search query params</h2> <p>While invoking the fetch method, we pass the query params to it in the form of id:(*). This means that I am looking for all items present in the store and id is a attribute of store. We can also replace id with any other attribute of store (say name). Now if I specify a value instead of * then I shall get results after searching for this value in the store for this property. Let us modify the above code sample with:</p> 1 <p>Now we shall get only those items which have 'a' as value of 'id' property. We can also perform a search based on multiple store properties like:</p> 1 <p>Here we are asking for items which have 'id' as 'a' and 'name' as 'b'. One can access the items searched on the store by using callback methods.</p> <h2>Search Callback methods</h2> <p>There are various call back methods and we shall discuss two out of them. First thing to note about call back methods is that you always get a reference to the items returned after performing search. Let us now discuss 'onComplete' and 'onItem' call back methods: onComplete : onComplete is called every time the search is complete. It is guaranteed to be called after search. The items are passed to it are the results of search query. onItem : This call back method is invoked only if an item has been found by search operation. The argument to this method is also search results. It is important to note that irrespective of call back being used, we can check if an item has been found or not by placing a check on item.length. If the length of items array is 0 then it means that no results were found. </p> <h2>Performance</h2> <p> You should try to utilize the results of a search as much as possible. Every time you perform a search there is some work to be done by the client browser. Say if you perform a search operation on click of combobox then there will be some delay in options being displayed for the combobox due to the processing involved. But again if you have update the store after last search operation, better perform a fresh search on store attributes. </p>