Hi there,
I'm starting to use grid, is the search/filter dataset function built-in? If so, is there a tutorial for using it? is the search case sensitive? if so, can I make it to be insensitive?
Thanks,
David
Hi there,
I'm starting to use grid, is the search/filter dataset function built-in? If so, is there a tutorial for using it? is the search case sensitive? if so, can I make it to be insensitive?
Thanks,
David
There are several paths you
There are several paths you can follow (nothing is ever simple, is it? :) ).
You have multiple data stores from which to choose.
But, the good part is all adhere to the "api" that is described in Chapter 3 of the Book, dojo.data section.
The query can be case-sensitive or case-insensitive.
Filtering can be done by just re-setting the "query" and calling for a "model" refresh.
The standard query is an "AND" query of one or more field:value sets, with value accepting * and ? as wild cards.
If you need complex filters (queries), i.e., regEx, and/or/not, JS Query, there are a few options there also.
If you describe your data, and how you want to manipulate it within the Grid, someone will chime in and suggest specific stores and approaches.
queryOptions: {ignoreCase:
queryOptions: {ignoreCase: true}
Thomas
re: search/filter in grid
I'm also trying to make a search function on my grid. How do I re-set the "query" and call for a "model" refresh?
I have created my grid like this:
<table id="grid" dojoType="dojox.grid.Grid" store="wishStore" rowsPerPage="100" query="{ buyerAcctNum: '*' }" clientSort="true" onCellClick="myClickEvent">
<thead>
<tr>
<th field="buyerAcctNum" width="100em">Buyer Acct #</th>
<th field="buyerLastName">Buyer Last Name</th>
</tr>
</thead>
</table>
And my datastore like this:
<div dojoType="dojo.data.ItemFileReadStore"
jsId="wishStore"
url="/dojoReservationDocs?ReadForm" >
</div>
And my search field and search button like this:
<div id="Search" style="text-align: right; width: 320px;">
<input type="text" id="SearchField" dojoType="dijit.form.TextBox" style="width:10em;"/>
<span id="SearchButton" label="Search" dojoType="dijit.form.Button" onclick="">
Search
</span>
</div>