Results 1 to 4 of 4

Thread: Error at treeStore appendChild

  1. #1
    Sencha User
    Join Date
    Mar 2019
    Posts
    1
    Vote Rating
    0
      0  

    Default Error at treeStore appendChild

    Hi all! I try to appendChild to treeStore and getting "Uncaught TypeError: T is not a constructor".
    If in treePanel store is specified like store: 'storealias' - it's okay, appendChild is done. But if I using store binded into viewmodel, i get the error above.
    this is my panel
    Code:
    Ext.define('Thesis.view.users.UserTree', {
        extend: 'Ext.tree.Panel',
    
        controller: 'users',
    
    title: 'Дерево пользователя', //User's tree
        itemId: 'userTree',
    
        width: 1260,
        height: 750,
        rootVisible: true,
        floating: true,
    
        buttons: [{
            text: 'Отмена', //Cancel
            iconCls: 'x-fa fa-times',
            handler: 'onCancelForm'
    }]
    
    });
    this is my viewmodel
    Code:
    Ext.define('Thesis.viewmodel.TreePanelModel', {
        extend: 'Ext.app.ViewModel',
        alias: 'viewmodel.treepanelt',
    
        stores: {
            treeStore: {
                type: 'tree',
    
                fields: [{
                    name: 'text',
                    mapping: 'name'
    }],
    
                root: {
                    expanded: true,
                },
    
                proxy: {
                    type: 'memory',
                    autoLoad: true,
                    reader: {
                        typeProperty: 'mtype'
    }
                },
    
            }
        },
    });
    and part of controller
    Code:
                    myForm.setViewModel('treepanelt');
                    myForm.setBind({
                        store: '{treeStore}'
    });
    
    vm = myForm.getViewModel();
                    userTreeStore = vm.getStore('treeStore');
                    var rootNode = userTreeStore.getRootNode();
    
                    rootNode.appendChild({
                        text: 'sometext',
                        leaf: true,
                        expanded: true
    });
    So what do you think?

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    938
    Answers
    5
    Vote Rating
    -498
      0  

    Default

    Thank you so much for your post. I apologize for the delay. I have shared this with the support staff to look into at their earliest convenience. Your patience is greatly appreciated! We do suggest using the support portal when you need assistance with a capability of a Sencha product, you have identified a situation where a products behavior is inconsistent with the product documentation and might indicate a software bug, or when the communication between you and Sencha needs to be private.

    Thanks again,

    Michele


  3. #3
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    417
    Answers
    4
    Vote Rating
    -308
      0  

    Default

    Hello,


    Thank you for contacting Sencha Support!


    We will be looking into this post and and update on it shortly. We will contact if we need additional information.


    Regards,
    Kumar
    Sencha Support.

  4. #4
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    417
    Answers
    4
    Vote Rating
    -308
      0  

    Default

    Hello,

    I have tested this in the below fiddle in 6.7.0, 6.6.x, 6.5.x and 6.2.x however couldn't reproduce the issue. I request you to please check once.

    https://fiddle.sencha.com/#view/editor&fiddle/2rkq

    Regards,
    Kumar
    Sencha Support.

Posting Permissions

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