1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    11
    Vote Rating
    0
    roman.buzuk is on a distinguished road

      0  

    Default Answered: Using Examples

    Answered: Using Examples


    Sorry for mistakes in English.
    I am trying to use example from Drag and Drop betweens two TreePanels, but it isn`t working good. When I try to expand folders or drag, I receive error that 'internalId' is null or not object'.
    I`m using ASP.NET.
    It is code of webform
    Code:
    <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="TestTree.WebForm1" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <link rel="stylesheet" type="text/css" href="js/resources/css/ext-all.css" />
        <!-- GC -->
    <script type="text/javascript" src="js/ext-all.js"></script>
    <style type="text/css">
    #tree, #tree2 {
        float: left;
        margin: 20px;
    }
    </style>
    <script type="text/javascript" language="javascript">
        Ext.require(['*']);
    
    
        Ext.onReady(function () {
            var store = Ext.create('Ext.data.TreeStore', {
                proxy: {
                    type: 'ajax',
                    url: 'aaa.php'
                },
                root: {
                    text: 'Ext JS',
                    id: 'src',
                    expanded: true
                },
                folderSort: true,
                sorters: [{
                    property: 'text',
                    direction: 'ASC'
                }]
            });
    
    
            var tree = Ext.create('Ext.tree.Panel', {
                id: 'tree',
                store: store,
                width: 250,
                height: 300,
                viewConfig: {
                    plugins: {
                        ptype: 'treeviewdragdrop',
                        appendOnly: true
                    }
                },
                renderTo: 'ftree'
            });
    
    
            var store2 = Ext.create('Ext.data.TreeStore', {
                proxy: {
                    type: 'ajax',
                    url: 'aaa.php'
                },
                root: {
                    text: 'Custom Ext JS',
                    id: 'src',
                    expanded: true,
                    children: []
                },
                folderSort: true,
                sorters: [{
                    property: 'text',
                    direction: 'ASC'
                }]
            });
    
    
            var tree2 = Ext.create('Ext.tree.Panel', {
                id: 'tree2',
                width: 250,
                height: 300,
                store: store2,
                viewConfig: {
                    plugins: {
                        ptype: 'treeviewdragdrop',
                        appendOnly: true
                    }
                },
                renderTo: 'ftree'
            });
        });
    </script>
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"><div id="ftree" /></asp:PlaceHolder>
    </asp:Content>
    File `aaa.php` is copy of file 'get-nodes.php' from example. Can you explain me, where is error and how to fix it?

  2. If a node (not a leaf) has no children specified, it will try to load it via the tree store's proxy. If you give it an empty array, children : [], it shouldn't try to load children.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,656
    Vote Rating
    436
    Answers
    3108
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    What Ext JS 4.x.x version are you using?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Nov 2012
    Posts
    11
    Vote Rating
    0
    roman.buzuk is on a distinguished road

      0  

    Default


    4.1.1
    As I understand, problem is that, when node is expanded, tree is loaded again. How can I deny that?

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,656
    Vote Rating
    436
    Answers
    3108
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    If a node (not a leaf) has no children specified, it will try to load it via the tree store's proxy. If you give it an empty array, children : [], it shouldn't try to load children.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  6. #5
    Sencha User
    Join Date
    Nov 2012
    Posts
    11
    Vote Rating
    0
    roman.buzuk is on a distinguished road

      0  

    Default


    Thanks, problem is solved.

Tags for this Thread