Results 1 to 2 of 2

Thread: Problem with adding node in a treePanel

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    Metz, France
    Posts
    60
    Vote Rating
    2
      0  

    Default Problem with adding node in a treePanel

    Hello everybody

    I want to add actioncolumn in a treegrid (based on this example) which allows to add nodes.

    I have follow a post to do that.

    So I have :

    Code:
    handler:function(){
      var Document = store.getRootNode();
      var insertedNode = Document.appendChild("New node");
      Document.data.leaf = false;
    }
    where store
    Code:
    Ext.define('Request', {
      extend: 'Ext.data.Model',
      fields: [
        {name: 'request',type: 'string'}
      ]
    });
        
    var store = Ext.create('Ext.data.TreeStore', {
      model: 'Request',
      proxy: {
        type: 'ajax',
        url: 'treegrid.json'
      },
      folderSort: true,
        id: 'source'
    });
    I got the error modelClass is undefined.

    Can someone help me ? Thank you...

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Location
    Metz, France
    Posts
    60
    Vote Rating
    2
      0  

    Default

    I found the origin of this problem :

    I was done :
    Code:
    Document.appendChild('New Child');
    Indeed of doing that :
    Code:
    Document.appendChild({leaf: true,request: 'New Child'});

Posting Permissions

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