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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:48:20+00:00 2026-05-31T18:48:20+00:00

Is it possible to get a node by its internalId? I tried: Store Ext.define(‘myStore’,

  • 0

Is it possible to get a node by its internalId? I tried:

Store

Ext.define('myStore', {
  extend: 'Ext.data.TreeStore',
  storeId: 'treestore',
  root: {
    text: 'root',
    children: [{
      text: 'leaf1',
      id: 'leaf1',
      children: [{
        text: 'child1',
        id: 'child1',
        leaf: true
      },{
        text: 'child2',
        id: 'child2',
        leaf: true
      }]
    },{
      text: 'leaf2',
      id: 'leaf2',
      leaf: true
    },{
      text: 'leaf3',
      id: 'leaf3',
      leaf: true
    }]
  },
  proxy: {
    type: 'memory',
    reader: {
      type: 'json'
    }
  }
});

Tree

Ext.create('Ext.tree.Panel', {
  id: 'myTree',
  rootVisible: false,
  store: Ext.create('myStore'),
  width: 300,
  height: 500,
  renderTo: Ext.getBody()
});

Adding and getting node

Ext.getCmp('myTree').getRootNode().appendChild({id: 'test', text: 'test', leaf: true});  // this test node takes on the internalId 'ext-record-2'
Ext.getCmp('myTree').store.getNodeById('ext-record-2');  // returns undefined
Ext.getCmp('myTree').getRootNode().findChild('id', 'ext-record-2', true);  // returns null
Ext.getCmp('myTree').getRootNode().findChild('internalId', 'ext-record-2', true);  // I was just trying things at this point.

I realize this probably isn’t possible, so I’ll explain what I’m trying to do… I’m trying to change the id of a node, so when I use getNodeById, I can use the new id that I made. The idea is, if I changed the id, I could find it in the tree and it would be unique because I only allow for adding unique id’s… but the id wouldn’t change. I then thought using the ‘ext-record’ id would make sure I return a unique id, but then I couldn’t figure that out, haha.

Here’s some code showing what I’d like to do.

var node = Ext.getCmp('myTree').store.getNodeById('test');  // returns my test node
node.beginEdit();
node.set('id', 'blah');
node.endEdit();
node.commit(false);
alert(Ext.getCmp('myTree').store.getNodeById('blah'));  // returns undefined
alert(Ext.getCmp('myTree').store.getNodeById('test'));  // still returns my test node

I tried using the tree’s sync method, but that didn’t do anything. I’m just wondering how I can update the node’s id, so when I use getNodeById, I can use the new id. Any thoughts?

  • 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-31T18:48:21+00:00Added an answer on May 31, 2026 at 6:48 pm

    Couple things:

    1. Try to debug it step by step. I.e. debug what you’re getting after Ext.getCmp().store and Ext.getCmp().getTreeRoot(). Check if the node has any children in array.

    2. What exactly is beginEdit/endEdit? NodeInterface doesn’t have these methods.

    3. Why are you trying to change Id? I’m just curious – it’s very unusual task for my taste.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible in jdom to get the children of a node that share
Possible Duplicate: Get image data in Javascript? Convert an image into binary data in
Is it possible to get quantity of attributes in node in XPATH? Like :
does anyone know how to (if possible) get the owner of the tag on
I am trying to work out if it is possible get JPA to persist
Possible Duplicate: Get CVS history for a particular user Is it possible to list
Possible Duplicate: Get all files from VSS for a given date? I need to
Possible Duplicate: Get a list of dates between two dates This is my sql:
Possible Duplicate: Get URL of ASP.Net Page in code-behind I'm trying to hold current
Possible Duplicate: Get full path of a file with FileUpload Control I want to

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.