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

  • Home
  • SEARCH
  • 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 8121813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:37:20+00:00 2026-06-06T05:37:20+00:00

I want to know how to insert items into a treestore sorted, if there

  • 0

I want to know how to insert items into a treestore sorted, if there is a way within extjs to do this. I then want to have the items appear in a treepanel sorted, although there may already be some nodes in the treepanel;

So, that question may be, how do I have a treepanel reload what it is displaying based on what is within my store. Let me be clear, I do not want to reload the store from some datasource. I want to reload the panel to reflect what is contained within the store. What is the best way to go about this?

  • 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-06-06T05:37:22+00:00Added an answer on June 6, 2026 at 5:37 am

    There is no real default way to do this. What your going to have to do is create an empty store on the page that uses the same model as the tree, something really simple like this:

    var mySortStore = Ext.create("Ext.data.Store", {
        model: "MyTreeStore",
        data:  []
    });
    

    Then when you go to add the node to the tree, use this function instead:

    function addNodeSorted(node, childToBeAdded){
        //clear the store from previous additions
        mySortStore.removeAll();
        //remove old sorters if they are dynamically changing
        mySortStore.sort();
        //add the node into the tree
        node.appendChild(childToBeAdded);
        var cn = node.childNodes,
            n;
    
        //remove all nodes from their parent and add them to the store
        while ((n = cn[0])) {
            mySortStore.add(node.removeChild(n));
        }
    
        //then sort the store like you would normally do in extjs, what kind of sorting you want is up to you
        mySortStore.sort('height', 'ASC');//this is just an example
    
        //now add them back into the tree in correct order
        mySortStore.each(function(record){
            node.appendChild(record);
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know if there is a way I can insert values into a
I want to insert data into a table where I don't know the next
I want to insert this margin, but I don't know why... I want it
I have an android app it displays web view.I want know the app idle
I'm making a chat responder for a game and i want know if there
There is a table with an int field - field_1. I want to insert
I want to insert a object at a given index. and If Is there
I have a SQLClient.DataSet in VB.NET, and I want to insert the entire thing
I have this problem and I don't know what is the best solution for
I'd like to insert JComponents into the top of a JList. Specifically, I want

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.