Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6989859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:16:08+00:00 2026-05-27T19:16:08+00:00

For example, say I have a server API for loading people that handles requests

  • 0

For example, say I have a server API for loading people that handles requests like this: GET /people/?id=101,329,27

I’d like to build a Store (probably a custom class that extends Ext.data.Store) which–assuming it has a list of people IDs–causes the proxy to make a request like the one shown above so that the returned data is only for that subset of persons.

I saw the documentation regarding remote filtering, but my concern is that to use it I would first need to call store.load() which would load all persons, then call filter() to do remote filtering. I’d like to just load the subset of persons the first time.

Thanks for any advice!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:16:08+00:00Added an answer on May 27, 2026 at 7:16 pm

    Found a solution (although still open to hearing other ideas).

    First, you can call a store’s load() function with a config object that will be passed to an operation. The API docs for Ext.data.Operation make it clear that one of the config options is for an array of Filter objects, so you can do this:

    var idFilter = Ext.create('Ext.util.Filter', {
      property: 'id',
      value: '100,200,300'
    });
    
    myStore.load({
      filters: [ idFilter ]
    });
    

    This results in a request where the URL querystring contains ?filter=[{"property"%3Aid%2C"value"%3A100,200,300}] (in other words, a URL-encoded version of [{ property: 'id', value: '100,200,300'}]).

    You can also just call myStore.filter('id', '100,200,300') without having called .load() first. Assuming you have remoteFilter=true in your store, this will make a request with the same query params shown agove.

    Sidenote: you can change the keyword used for ‘filter’ by configuring the ‘filterParam’ config option for the proxy. For example, if filterParam=q, then the querystring shown above changes to: ?q=[{"property"%3Aid%2C"value"%3A100,200,300}]

    Second, you can control “structure” of the filter in the querystring. In my case, I didn’t want something like filter={JSON}, as shown above. I wanted a querystring that looked like this:?id=100,200,300
    For this I needed to extend a proxy and override the default getParams() function:

    Ext.define('myapp.MyRestProxy', {
        extend: 'Ext.data.proxy.Rest',
    
        /**
         * Override the default getParams() function inherited from Ext.data.proxy.Server.
         *
         * Note that the object returned by this function will eventually be used by
         * Ext.data.Connection.setOptions() to include these parameters via URL
         * querystring (if the request is GET) or via HTTP POST body. In either case,
         * the object will be converted into one, big, URL-encoded querystring in
         * Ext.data.Connection.setOptions() by a call to Ext.Object.toQueryString.
         * 
         * @param {Ext.data.Operation} operation
         * @return {Object}
         *  where keys are request parameter names mapped to values
         */
        getParams: function(operation) {
            // First call our parent's getParams() function to get a default array
            // of parameters (for more info see http://bit.ly/vq4OOl).
            var paramsArr = this.callParent(arguments),
                paramName,
                length;
    
            // If the operation has filters, we'll customize the params array before
            // returning it.
            if( operation.filters ) {
                // Delete whatever filter param the parent getParams() function made
                // so that it won't show up in the request querystring.
                delete paramsArr[this.filterParam];
    
                // Iterate over array of Ext.util.Filter instances and add each
                // filter name/value pair to the array of request params.
                for (var i = 0; i < operation.filters.length; i++) {
                    queryParamName = operation.filters[i].property;
    
                    // If one of the query parameter names (from the filter) conflicts
                    // with an existing parameter name set by the default getParams()
                    // function, throw an error; this is unacceptable and could cause
                    // problems that would be hard to debug, otherwise.
                    if( paramsArr[ queryParamName ] ) {
                        throw new Error('The operation already has a parameter named "'+paramName+'"');
                    }
    
                    paramsArr[ queryParamName ] = operation.filters[i].value;
                }
            }
    
            return paramsArr;
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a https site say with url www.example.com. On this server, I've an
To use as an example: lets say that I have 2 EditText s and
i have problem use link_to_remote link_to_remote document example say link_to_remote Delete this post, :update
Say I have a site on http://example.com . I would really like allowing bots
Say I have this url: http://site.example/dir/ In this folder I have these files: test.ascx.cs
Let's say I have this url: www.example.com/test.php?page=4 How do i retrieve the value of
Lets say that we have a server running multiple virtual hosts. Somefiles and directories
Take a very simple case as an example, say I have this URL: http://www.example.com/65167.html
Say I have an XML document on a web server ( www.example.com/example.xml ). On
Let's say I have a URL: http://example.com/person/list This website will display a list of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.