Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From the <a href="http://dev.sencha.com/deploy/gxt-3.0.0/javadoc/gxt/com/sencha/gxt/widget/core/client/grid/filters/Filter.html" rel="nofollow">filter</a> javadoc :</p> <blockquote> <p>To add a filter to a Grid column, create an instance of a concrete subclass of Filter, passing to the constructor the ValueProvider for the column, then add the filter to a GridFilters</p> </blockquote> <p>Your code sample seems too restrinct and should probably be parameterized. The StringFilter should be given a ValueProvider for the property of the model object you wish to filter. Following is a simple overview of how to create a Grid with Filters.</p> <p>Let's say you have a class User</p> <pre><code>public class User implements Serializable { private String name; private Integer id; // Setters and getters } public interface UserProperties extends PropertyAccess&lt;User&gt; { @Path("id") ModelKeyProvider&lt;User&gt; key(); ValueProvider&lt;User, String&gt; name(); } </code></pre> <p>To create a grid that will display your users, you would do as follow</p> <pre><code>private static final UserProperties props = GWT.create(UserProperties.class); ... // Create column config ColumnConfig&lt;User, String&gt; nameCol = new ColumnConfig&lt;User, String&gt;(props.name(), 200, "Name"); // Create column model List&lt;ColumnConfig&lt;User, ?&gt;&gt; l = new ArrayList&lt;ColumnConfig&lt;User, ?&gt;&gt;(); l.add(nameCol); ColumnModel&lt;User&gt; cm = new ColumnModel&lt;User&gt;(l); // Create User store ListStore&lt;User&gt; store = new ListStore&lt;User&gt;(props.key()); // Create your grid final LiveGridView&lt;User&gt; liveGridView = new LiveGridView&lt;User&gt;(); liveGridView.setForceFit(true); Grid&lt;User&gt; view = new Grid&lt;User&gt;(store, cm) { @Override protected void onAfterFirstAttach() { super.onAfterFirstAttach(); // Get grid data } }; // Create a String filter for the column StringFilter&lt;User&gt; nameFilter = new StringFilter&lt;User&gt;(props.name()); // Create a GridFilters GridFilters&lt;User&gt; filters = new GridFilters&lt;User&gt;(); filters.initPlugin(grid); filters.setLocal(true); filters.addFilter(nameFilter); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload