- 浏览: 2151255 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
sunzeshan:
找了很久,用了这个插件解决问题啦。谢谢
eclipse jetty debug source not found -
xiaosong0112:
您好,请问为什么要这样设置呢,原理是什么?在网上很多转帖都没有 ...
maven的jetty插件提示No Transaction manager found导致启动慢的解决方法 -
eimhee:
tjzx 写道畅搜谷歌:http://dian168.cc/打 ...
Google 镜像站搜集 -
tjzx:
畅搜谷歌:http://dian168.cc/打开的是“最火源 ...
Google 镜像站搜集 -
eimhee:
finallygo 写道你这属于"头痛医头脚痛医脚& ...
解决linux下too many file问题
When building a tree without using a treeloader, I can't seem to be able to specify the children of a node. Instead, I have to manually call "new Ext.tree.TreeNode()" for every node I want and then manually add it to the tree using the appendChild() method. Ideally, we should be able to pass a config as deep as necessary (like we can with AsyncTreeNode) and it'll all get added to the tree.
Does not work (grandchildren aren't created):
Also does not work (children aren't even created):
Does not work (grandchildren aren't created):
Ext.onReady(function() { var tree = new Ext.tree.TreePanel('tree'); var root = new Ext.tree.TreeNode({ text : 'My Root', id : 'my-root' }); tree.setRootNode(root); var child1 = new Ext.tree.TreeNode({ text: 'Child 1', id: 'child-1' }); var child2 = new Ext.tree.TreeNode({ text: 'Child 2', id: 'child-2' }); var child3 = new Ext.tree.TreeNode({ text: 'Child 3', id: 'child-3', children: [ { text: 'Grandchild 1', id: 'grandchild-1' }, { text: 'Grandchild 2', id: 'grandchild-2' } ]}); root.appendChild(child1, child2, child3); tree.render(); });
Ext.onReady(function() { var tree = new Ext.tree.TreePanel('tree'); var root = new Ext.tree.TreeNode({ text : 'My Root', id : 'my-root', children: [ { text: 'Child 1', id: 'child-1' }, { text: 'Child 2', id: 'child-2' }, { text: 'Child 3', id: 'child-3', children: [ { text: 'Grandchild 1', id: 'grandchild-1' }, { text: 'Grandchild 2', id: 'grandchild-2' } ]} ] }); tree.setRootNode(root); // Generates error: tree has no properties! tree.render(); });
#2
03-04-2007, 09:21 PM
|
In order to get the automated conversion of JSON to nodes, it goes through the TreeLoader. Think of the TreeLoader as not only loading through the server, but also in the browser as well. So you need to use an AsyncTreeNode instead of TreeNode. Luckily this involves no extra work.
|
#3
03-04-2007, 10:06 PM
|
Ok, fair enough. So, theoretically, changing Ext.tree.TreeNode to Ext.tree.AsyncTreeNode should do the trick. However, the following doesn't work:
Ext.onReady(function() { var tree = new Ext.tree.TreePanel('tree'); var root = new Ext.tree.AsyncTreeNode({ text : 'My Root', id : 'my-root', children: [ { text: 'Child 1', id: 'child-1' }, { text: 'Child 2', id: 'child-2' }, { text: 'Child 3', id: 'child-3', children: [ { text: 'Grandchild 1', id: 'grandchild-1' }, { text: 'Grandchild 2', id: 'grandchild-2' } ]} ] }); tree.setRootNode(root); tree.render(); }); Thinking maybe it's just an issue with trying to stuff all that in the root before it's set as the root node, I tried this: Ext.onReady(function() { var tree = new Ext.tree.TreePanel('tree'); var root = new Ext.tree.TreeNode({ text : 'My Root', id : 'my-root' }); tree.setRootNode(root); var child1 = new Ext.tree.TreeNode({ text: 'Child 1', id: 'child-1' }); var child2 = new Ext.tree.TreeNode({ text: 'Child 2', id: 'child-2' }); var child3 = new Ext.tree.AsyncTreeNode({ text: 'Child 3', id: 'child-3', children: [ { text: 'Grandchild 1', id: 'grandchild-1' }, { text: 'Grandchild 2', id: 'grandchild-2' } ]}); root.appendChild(child1, child2, child3); tree.render(); }); |
#4
03-04-2007, 10:09 PM
|
> In order to get the automated conversion of JSON to nodes, it goes through the TreeLoader
|
#5
03-04-2007, 10:19 PM
|
Ok, so the solution is to explicitly define a loader for the TreePanel.
Ext.onReady(function() { var tree = new Ext.tree.TreePanel('tree', { loader: new Ext.tree.TreeLoader() }); var root = new Ext.tree.AsyncTreeNode({ text : 'My Root', id : 'my-root', children: [ { text: 'Child 1', id: 'child-1', leaf: true }, { text: 'Child 2', id: 'child-2', leaf: true }, { text: 'Child 3', id: 'child-3', children: [ { text: 'Grandchild 1', id: 'grandchild-1', leaf: true }, { text: 'Grandchild 2', id: 'grandchild-2', leaf: true } ]} ] }); tree.setRootNode(root); tree.render(); }); |
#6
03-05-2007, 08:55 AM
|
Thanks for figuring this out Jeff/Jack. I tried 20 different ways to get this to work and, I don't think I would have ever thought to try that...
loader: new Ext.tree.TreeLoader() |
发表评论
-
jquery dual list 插件
2010-12-21 17:24 2393In my work, I came across the n ... -
Start PageIndexHistoryLast Change
2010-12-15 00:22 1049The specifications should provi ... -
ajax upload
2010-11-19 13:22 0ajax upload The following cri ... -
兼容IE和FF获取Referer的JS方法
2010-11-11 10:11 4556众所周知,我们web开发人员痛恨IE浏览器,因为IE不支持标准 ... -
jQuery优化
2010-09-16 08:30 5522之前,我们减少字节数和请求次数以及加载顺序以使页面加载的更快。 ... -
jQuery add table row
2010-08-23 13:39 0The approach you suggest is not ... -
Add and Remove items with jQuery
2010-08-23 13:25 0Add and Remove items with jQuer ... -
extjs和struts、json的整合
2009-08-13 09:52 4542使用extjs配合struts的MVC架构是目前流行的做法,两 ... -
extra 1px space in dialog handle style - Ext JS
2009-04-20 23:33 1593Im developing a new style and h ... -
Grid - Custom header renderer? - Ext JS
2009-04-20 23:33 2095Is it possible to create a cust ... -
Inputs to DatePicker - Ext JS
2009-04-20 23:33 2186I thought I had read that you c ... -
dateFormat with timezone - Ext JS
2009-04-20 23:33 3617If I create JSON data on server ... -
How to use Ext.each? - Ext JS
2009-04-20 23:33 4505I'm trying to use Ext.each. It ... -
afteredit event ... new value? - Ext JS
2009-04-20 23:33 1530the new value is not set before ... -
problem qith iframe's - Ext JS
2009-04-20 23:33 1156I want to have dialogs and wher ... -
[Grid] Ext.data documenation - Ext JS
2009-04-20 23:33 1493I'm porting my grids to use the ... -
Last column to auto-adjust - Ext JS
2009-04-20 23:33 2720I can't see that this is curren ... -
Bug - reload method of AsyncTreeNode - Ext JS
2009-04-20 23:32 2031Happens when the tree config o ... -
Minor grid paging toolbar issues - Ext JS
2009-04-20 23:32 1544When a grid toolbar is displaye ... -
Grid context menu - Ext JS
2009-04-20 23:32 2118I've made a grid with a context ...
相关推荐
在Android应用开发中,网络通信是必不可少的一部分,而`android-async-http`库是一个非常流行的异步HTTP客户端库,特别适合处理与服务器的交互。这个库由Leonardo Uribe创建,它提供了简单易用的API,使开发者可以...
MongoDB异步驱动程序(mongodb-async-driver)是为Java开发者设计的一个库,它允许应用程序以非阻塞的方式与MongoDB服务器进行通信,提高了处理大量并发请求的能力。 在"mongodb-async-driver-2.0.1.jar"这个特定...
这些版本可能包含各种性能改进、bug修复和新功能。例如,早期版本可能解决了一些已知问题,而后期版本则可能添加了对新API或网络协议的支持。选择合适的版本取决于你的项目需求和兼容性考虑。 Android-Async-Http库...
前端开源库-babel-helper-remap-koa2-async-to-generatorbabel-helper-remap-koa2-async-to-generator,将异步函数转换为ES2015生成器(koav2->koav1)。
### JavaScript异步与性能:深入理解《You Don't Know JS - Async & Performance》 #### 引言 《You Don't Know JS - Async & Performance》是一本深入探讨JavaScript中异步编程与性能优化的经典著作。本书旨在...
vue-async-computed, Vue.js的异步计算属性 vue-async-computed 这里插件的为Vue兼容 ! 可以使用这个插件在Vue中计算出异步计算的属性。不使用这里插件,你无法执行这里操作:new Vue({ data: { us
Like other books in this series, You Don't Know JS: Async & Performance dives into trickier parts of the language that many JavaScript programmers simply avoid. Armed with this knowledge, you can ...
Build Status ...https://github.com/loopj/android-async-http/blob/1.4.9/CHANGELOG.md Javadoc Latest Javadoc for 1.4.9 release are available here (also included in Maven repository): ...
要使用`babel-plugin-transform-async-to-promises`,你需要安装Babel和这个插件,然后在Babel配置文件(通常是`.babelrc`或`babel.config.js`)中添加插件到转换队列。以下是一个基本示例: ```json { "plugins":...
mongodb-async-driver-2.0.1驱动文件 jar MongoDB Async Java Driver Documentation Welcome to the MongoDB Async Java driver documentation hub. Getting Started The Getting Started guide contains ...
`android-async-http-1.4.9` 是一个专为Android设计的异步HTTP库,它简化了网络请求的处理流程,使开发者能够更高效地进行网络通信。这个库由Leonard Brünings创建,并且在早期的Android开发中广泛使用。 ### 异步...
"Android-Async-Http"是一个流行的开源框架,专为Android平台设计,用于简化网络请求处理。这个框架的主要目标是让Android开发者能够更高效、更轻松地进行异步HTTP通信,从而获取网络数据或向服务器发送数据。在...
在JavaScript中,`require.async`允许我们在运行时动态加载模块,而不是一次性加载所有代码。这种方式尤其适用于大型应用,可以减少首屏加载时间,提高用户体验。例如,当用户导航到某个页面时,只加载该页面所需的...
1)包里包含android-async-http-1.4.11.jar 和 httpclient-4.5.8.jar两个文件 2)强大的网络请求库,主要特征如下: 处理异步Http请求,并通过匿名内部类处理回调结果 Http请求均位于非UI线程,不会阻塞UI操作 通过...
mkdir -p ~/build && \ cd ~/build && \ rm -rf ./swoole-src && \ ...tar zxvf ./tmp/swoole.tar.gz && \ ...--enable-async-redis \ --enable-sockets \ --enable-mysqlnd && \ make clean && make && sudo make install
android-async-http官方项目:来自Github; 该项目中包含了多个版本的android-async-http.jar包,目前最新版本是:android-async-http-1.4.5.jar; 地址:原项目地址:https://github.com/loopj/android-async-http
强大的网络请求库,主要特征如下: 处理异步Http请求,并通过匿名内部类处理回调结果 Http请求均位于非UI线程,...通过线程池处理并发请求 处理文件上传、下载 响应结果自动打包JSON格式 自动处理连接断开时请求重连
**前端开源库 `multihashing-async` 深度解析** 在当今的Web开发领域,前端开源库扮演着至关重要的角色,它们为开发者提供了强大的工具和功能,以提高开发效率和代码质量。`multihashing-async` 就是这样一个专为...
最新异步网络请求android-async-http-1.4.5.jar
android的异步网络加载,方便使用,免去多余的代码