-
22 Nov 2012 12:15 AM #1
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
File `aaa.php` is copy of file 'get-nodes.php' from example. Can you explain me, where is error and how to fix it?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>
-
Best Answer Posted by mitchellsimoens
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.
-
23 Nov 2012 1:09 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 436
- Answers
- 3108
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.
-
25 Nov 2012 10:01 PM #3
4.1.1
As I understand, problem is that, when node is expanded, tree is loaded again. How can I deny that?
-
26 Nov 2012 5:45 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 436
- Answers
- 3108
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.
-
28 Nov 2012 12:26 AM #5


Reply With Quote