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 6705933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:27:41+00:00 2026-05-26T07:27:41+00:00

I appreciate the help and support that you all given me to get started

  • 0

I appreciate the help and support that you all given me to get started with Sencha Touch. Now i got into some complex business scenarios handling, where i feel much more difficulty to deal with it. Here are my business needs.

  1. On successful login to the application, the sencha client receives the JSON object response where, all the available products and codes are there. Also, the states tag contains the exclude product list. The JSON format sample i have pasted below.

  2. I have to have a form, where i will have to display the states and products drop down box. The UI part is fine. i have done with it. But now the complexity is when i select a state, i have to exclude the list of the products from the total available products.

  3. I have used the Ajax request and then decode method to decode the JSON response. Now i have the complete JSON as an Object.

  4. I have 2 stores, one for products list and other for states list. I don’t requires any of my store to be sync with server, as it increases data usages.

  5. Listener for option control is also done, now how can i manipulate the JSON and update the products Store dynamically. Please suggest.

Here is the sample JSON response:

{   
    "defaultProducts": {
        "product": [
            {
                "code": "pro1",
                "name": "Product AA"
            }, {
                "code": "pro1",
                "name": "Product BB"
            }, {
                "code": "pro1-INP",
                "name": "Product CC"
            }, {
                "code": "uni1-sc",
                "name": "Product DD"
            }, {
                "code": "pro1",
                "name": "Product EE"
            }, {
                "code": "uni1-sc",
                "name": "TCO - Enhanced"
            }, {
                "code": "uni1",
                "name": "Product FF"
            }, {
                "code": "uni1",
                "name": "Product GG"
            }
        ]
    },
    "states": {
        "state": [
            {
                "excludeProducts": {
                    "excludeProduct": [
                        {
                            "code": "pro1",
                            "name": "Product BB"
                        }, {
                            "code": "pro1-INP",
                            "name": "Product CC"
                        }, {
                            "code": "pro1",
                            "name": "Product EE"
                        }, {
                            "code": "uni1",
                            "name": "Product FF"
                        }, {
                            "code": "uni1",
                            "name": "Product GG"
                        }
                    ]
                },
                "code": "AL",
                "name": "Alabama"
            }, {
                "excludeProducts": {
                    "excludeProduct": [
                        {
                            "code": "pro1",
                            "name": "Product BB"
                        }, {
                            "code": "pro1-INP",
                            "name": "Product CC"
                        }, {
                            "code": "pro1",
                            "name": "Product EE"
                        }, {
                            "code": "uni1",
                            "name": "Product FF"
                        }, {
                            "code": "uni1",
                            "name": "Product GG"
                        }
                    ]
                },
                "code": "AK",
                "name": "Alaska"
            }, {
                "excludeProducts": {
                    "excludeProduct": [
                        {
                            "code": "pro1",
                            "name": "Product BB"
                        }, {
                            "code": "pro1-INP",
                            "name": "Product CC"
                        }, {
                            "code": "uni1-sc",
                            "name": "Product DD"
                        }, {
                            "code": "pro1",
                            "name": "Product EE"
                        }, {
                            "code": "uni1-sc",
                            "name": "TCO - Enhanced"
                        }
                    ]
                },
                "code": "AZ",
                "name": "Arizona"
            }, {
                "excludeProducts": {
                    "excludeProduct": [
                        {
                            "code": "pro1",
                            "name": "Product BB"
                        }, {
                            "code": "pro1-INP",
                            "name": "Product CC"
                        }, {
                            "code": "pro1",
                            "name": "Product EE"
                        }, {
                            "code": "uni1",
                            "name": "Product FF"
                        }, {
                            "code": "uni1",
                            "name": "Product GG"
                        }
                    ]
                },
                "code": "AR",
                "name": "Arkansas"
            }
        ]
    },
    "licensedTo": "mycomp.com"
}

Please, guide me any other logic that i could use to implement such complex scenarios.

  • 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-26T07:27:41+00:00Added an answer on May 26, 2026 at 7:27 am

    You should attach listener so the state drop down box and then add filters to the product list depending on the items you want to exclude.

    This is how your change listener on the state drop down box should look like:

      listeners: {
            change:function(selectfield, value){
                //here you should get reference to the excludeProduct array
                var exProductArray = [];
    
                //then add filter to the product store like this
                productStore.clearFilter(false); // clears previous filters
    
                for(var i=0; i<exProductArray.length;++i){
                  productStore.filter("code",exProductArray[i].code);       
                }              
            }
       },
    

    To get reference to the productArray you can set the valueField to the state dropdown list to be the code property and also set the idProperty of the state model to be the code property. Then you can fetch the state record from the states store like this:

      var stateRecord = stateStore.getById(value);
    

    Where value is this value object change:function(selectfield, value){. Then after you get the proper stateRecord to get a reference to the productArray you should just do this:

     var exProductArray = stateRecord.excludeProducts.excludeProduct;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would appreciate some help with something I working on and have not done
I would appreciate some help with an UPDATE statement. I want to update tblOrderHead
I'm pretty new to Python programming and would appreciate some help to a problem
I have a problem finding references to this subject and would appreciate some help.
I am new to writing SQL and would greatly appreciate help on this problem.
have small problem, and would very much appreciate help :) I should convert byte
I would appreciate any help on this issue. Lets say I want to load
Would very much appreciate any help or hint on were to go next. I'm
I'm new to regular expressions and would appreciate your help. I'm trying to put
This is my first time on this site and I appreciate any help on

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.