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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:19:18+00:00 2026-05-22T17:19:18+00:00

I use TreeStore & TreePanel . I need to insert new node in my

  • 0

I use TreeStore & TreePanel. I need to insert new node in my Tree , how to this?

I have TreeStore component who following config:

var monPrestore = Ext.create('Ext.data.TreeStore', {
    folderSort : true,
    model : 'Task',
    proxy : {
        model : 'Task',
        appendId: true,
        type : 'ajax',
        url : '/intranet-timesheet2-tasks-extjs/getJSON.tcl',
        reader : {
            type : 'json'
        },
        writer : {
            type : 'json'
        },
    }

I have defined Task Model (it is what I want to insert) with blank value:

Ext.define('Task', {
    extend : 'Ext.data.Model',
    fields : [
        {
            name : 'task',
            type: 'string'
        },
        {
            name : 'material',
            type: 'string'
        },
        {
            name : 'cc',
            type: 'string'
        },
        {
            name : 'start_date',
            type: 'string'
        },
        {
            name : 'short_desc',
            type: 'string'
        },
        {
            name : 'id',
            type: 'string'
        }
    ]
});

I want to insert new record when event itemdlclick is fired:

I have tested that but it doesn’t work:

itemdblclick: function(view, model, htmlitem, index, e) {
    var task = {
        task: 't0',
        material: 'm0',
        cc: 'c0',
        start_date: '12',
        short_desc: 'sht',
        id: '120',
        leaf: true
    };

    monPretree.insert(4,task);          
}

Thanks a lot 🙂 !

  • 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-22T17:19:19+00:00Added an answer on May 22, 2026 at 5:19 pm

    I think you asked the similar question here!

    There is no insert method for tree panel. You will have to get hold of the tree’s root node to modify the tree. In your case, you might have to do the following:

    var rootNode = monPretree.getRootNode();
    rootNode.insertChild(4,task); 
    

    For other tree manipulation methods, refer the API documentation of NodeInterface.

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

Sidebar

Related Questions

use DBI(); What is causing this insert to fail to err 1, the SELECT
use this website a lot but first time posting. My program creates a number
Use case: I've just entered insert mode, and typed some text. Now I want
Use Case I need to package up our kml which is in a String
use Control::CLI; $cli = new Control::CLI('SSH'); $cli->connect(Host=>'10.10.10.10',Username=>'user',Password=>'pwd'); $cli->waitfor('>'); $cli->print('Show XXXXXXXXXXXXXXXXXXXX| grep Active'); @f=$cli->waitfor('>'); print
use WWW::Mechanize; my $mech = WWW::Mechanize->new; $mech->get( $url ); say $mech->text; How could I
use javascript or other method ? have any recommendation?
I have a Gtk::TreeView with a Gtk::TreeModel and a Gtk::TreeModelFilter. The Tree Model is
We have a requirement in which we need to load around 4000 records in
use case example I have a servlet that is receiving login requests. If a

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.