Results 1 to 5 of 5

Thread: Filtering a Nested List

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    27
    Answers
    2
    Vote Rating
    2
      0  

    Default Filtering a Nested List

    This should be a quick question: When filtering the store from which a nested list gets its data, should the nested list update automatically? I can't see any kind of refresh, or reload function.

    I'm simply filtering some JSON with the code below. I can see that the data is being filtered, but the nested list doesn't alter.

    Code:
                AllCoursesButton: {
                    tap: function(button){
                        if(button.getIconCls()=='docs2')
                        {
                            button.setIconCls('doc');
                            button.setText('Mobile Courses');
                            var ActiveStore=this.getCatalogList().getStore();
                            //debugger;
                            ActiveStore.filter('nametxt', 'Mobile Courses');
                            console.log(ActiveStore.getData().length);
                            //ActiveStore.load();
                        }
                        else
                        {
                            button.setIconCls('docs2');
                            button.setText('All Courses');
                            var ActiveStore=this.getCatalogList().getStore();
                            ActiveStore.clearFilter();
                            console.log(ActiveStore.getData().length);
                            //ActiveStore.load();
                        }
                    }
                }

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    The NestedList uses TreeStore but each child List uses a Node store so you can filter the Node store on the list for the node. It's not the simplest for the TreeStore.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    27
    Answers
    2
    Vote Rating
    2
      0  

    Default

    Thanks, Mitchell. I'm not sure I understand your answer fully, but, I have just iterated through the node list for the nested list, and removed the items that I want to filter out.

    I have tested (by using "eachChild"), and the node is definitely gone. Yet, there it still sits in the nested list.

    It seems that nothing I do to either the nested list, or the underlying data, has any effect on the items displayed in the nested list once it has been displayed.

    As the documentation is woefully inadequate, I am at a loss. How does one in any way manipulate the items displayed in a nested list, once that list has been displayed?

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    27
    Answers
    2
    Vote Rating
    2
      1  

    Default

    Oh well. As Sencha provides no usable documentation, and I can find nothing on the Internet, I'm having to treat the nested list as a dumb component, and simply filtering at the back-end with a parameter to the AJAX call.

  5. #5
    Sencha User
    Join Date
    May 2013
    Posts
    37
    Answers
    3
    Vote Rating
    1
      0  

    Default Filter function in nested list

    Am using a nested list, but didn't find out any option to filter the nested list. Can u please provide me an example about sorting nested list. Thanks in advance

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •