Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Two views, one datasource (filtering)

    Hello, I want to have two lists that get data from the same datasource, but I want them to have different views. One of them should show all the records that come from the server, the other one should show only the ones matching a criteria (which is fixed and not editable). I've seen two methods on the ListGrid to get filtered data, fetchData and filterData but the two of them call the underlying datasource to fetch data from the server. What I want to do is:

    1. Have a datasource and get all the server data in it.
    2. Have a list with the datasource showing all the records.
    3. Have a list with the data in the datasource but filtering the data on the list, not the datasource. I mean, only filtering the current view of data. There's no need to fetch any more data and if it's fetched, the view should filter it locally but it should not remove data from the datasource.

    Is it possible?

    #2
    From the Client Only DataSources docs :

    if you specify your DataSource as clientOnly: true, omit testData entirely, and provide either a dataURL or a testFileName, the DataSource will lazily make a one-time fetch against the specified data file the first time an operation is called on it. From then on, the DataSource will work against the local cache created from this initial request.
    Sanjiv

    Comment


      #3
      The problem is that my data source is a Gwt RPC data source, so I cannot provide a data url. I don't know if that's possible with this kind of data sources.
      Last edited by getaceres; 18 Sep 2009, 05:01.

      Comment


        #4
        So get the data from your service and create a client-only DataSource from it by calling setTestData().

        Comment

        Working...
        X