- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我加载了一个项目展开的 TreePanel(在我的 json 中定义)但是当它显示时它没有展开。
只是打开了目录(图标),但没有显示项目。我加载它使用加载存储功能重新加载我的树面板。
storeTree = me.getTreePersonneStore();
storeTree.load({
params: {
idPersonne: batch.proxy.getReader().jsonData.id,
lettrePersonne: batch.proxy.getReader().jsonData.lettre
}
})
我的商店:
Ext.define('ModuleGestion.store.TreePersonne', {
extend: 'Ext.data.TreeStore',
requires: [
'ModuleGestion.model.Personne'
],
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
autoLoad: true,
model: 'ModuleGestion.model.Personne',
storeId: 'StoreTreePersonne',
root: {
expanded : true,
text : 'Personnes',
expandable : true,
id : 'root',
nodeType:'async',
uiProvider:false
},
proxy: {
type: 'ajax',
node: 'id',
url: 'ModuleGestion/php/TreePersonne.php',
reader: {
type: 'json'
}
},
listeners: {
beforeload: {
fn: me.beforeload,
scope: me
}
}
}, cfg)]);
},
beforeload: function(store, operation, eOpts) {
operation.params.node = operation.node.get("id");
}
});
我的 JSON:
[{
id:"A",
text:"A",
expanded:true,
children:[
{
id:"101",text:"AA AA",leaf:true},
{id:"98",text:"AA AA",leaf:true},
{id:"86",text:"AA AA",leaf:true},
{id:"99",text:"AA AA",leaf:true},
{id:"96",text:"AA AA",leaf:true},
{id:"100",text:"AA AA",leaf:true},
{id:"97",text:"AA AA",leaf:true}]
}],
}]
我的树:
{
xtype: 'treepanel',
id: 'TreePersonne',
store: 'TreePersonne',
viewConfig: {
}
}
最佳答案
试试下面的 json。 child 也有扩展属性。
[{
id:"A",
text:"A",
expanded:true,
children:[
{
id:"101",text:"AA AA",leaf:true, expanded:true},
{id:"98",text:"AA AA",leaf:true, expanded:true},
{id:"86",text:"AA AA",leaf:true, expanded:true},
{id:"99",text:"AA AA",leaf:true, expanded:true},
{id:"96",text:"AA AA",leaf:true, expanded:true},
{id:"100",text:"AA AA",leaf:true, expanded:true},
{id:"97",text:"AA AA",leaf:true, expanded:true}]
}],
}]
或者,您也可以在面板加载后展开子项:
YOUR_TREE_PANEL.expandChildren(true);
关于javascript - Extjs TreePanel 未展开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17077992/
我想使用拖放操作将一棵树的根节点添加到另一棵树中。我用于此任务的示例位于以下 URL 中: http://gwt-ext.com/demo/#twoTrees 请尽快帮助我。 最佳答案 在同一个链接中
我正在使用 ExtJS 2.2.1 在我的网络应用程序中,我曾经有一个只有一个根的 TreePanel,如下所示: ` |- Colors |- Blue |- Red |- Yel
我做了一个Fiddle重现我的问题的测试用例:选择事件被触发两次。即使是 selectionchange 也是如此。但是 cellclick 只触发一次。我使用 ExtJS5.1.1 GPL。 注意:
如何使用 Ext.tree.ViewDDPlugin 的事件? 我有一个使用 DDPplugin 的 TreePanel,但我想知道如何监听 drop 事件。 这是我的代码的样子: var monPr
如何在 extjs 中刷新 TreePanel 的内容并保存节点状态(展开/折叠)。当我做的时候 fileList.root.reload(); 所有展开的节点都折叠起来。我怎样才能避免这种情况? 谢
我加载了一个项目展开的 TreePanel(在我的 json 中定义)但是当它显示时它没有展开。 只是打开了目录(图标),但没有显示项目。我加载它使用加载存储功能重新加载我的树面板。 storeTre
ExtJS 4: 我创建了一个树面板。我想为其节点设置自己的图标,因此我为每个节点使用了 iconCls 属性。它的工作。但是当我展开一个节点时,它会返回到其正常的“打开文件夹”图标。 var tre
我有一个树面板。当我过滤 TreePanel 的存储以使节点显示为空时,打开该节点的符号仍然存在。我认为如果文件夹内容不可见,打开文件夹的符号消失会更好。有解决办法吗? https://fiddle.
像这样的树状结构 var rootNode = { id: 'root', text : 'Root Node', expanded :
我用 TreeStore & TreePanel .我需要在我的 Tree 中插入新节点,如何做到这一点? 我有 TreeStore遵循配置的组件: var monPrestore = Ext.cre
当用户单击按钮时,我试图检索 TreePanel 的选定节点(如果有)。如何检索 TreePanel 中的选择节点?谢谢。 最佳答案 您要做的是创建一个事件处理程序。每个 ExtJs 对象都有许多与它
我遇到一个问题,在使用内联存储定义 TreePanel 时看不到树节点的文本。但是,如果我外部化存储定义并将其移动到一个单独的变量,然后将其分配给 TreePanel(如 API 文档中所示),则它工
我想创建一个 Treepanel,它每秒更新一次。所以我拿了一个有代理的商店来获取数据: store = new Ext.data.TreeStore({ model: 'TaskState'
我创建了这个简单的树: var children = [{ text:'My Layers', children:[ new Ext.tree
如何修改该示例 http://www.extjs.com/deploy/dev/examples/tree/reorder.html 需要 RESTful 支持? 当我们点击某个节点时,它发送 POS
如何使用本地 JSON 对象将一些任意数据加载到树面板中? ExtJS 4.0 发行版附带的所有示例都适用于 AJAX 请求。 最佳答案 有一个使用 MemoryProxy 的例子在 Sencha 文
我创建了一个 Ext.TreePanel 并且我会在节点中有一个图像,在节点的文本中我有图像的 url 但我无法在页面中加载它,我只看到文本,那里是否可以查看图像? 这是我的代码 var root1
我一直试图让我的树面板以两种方式滚动。这是我的代码:https://fiddle.sencha.com/#fiddle/13cb 我可以在包装面板中设置scrollable: true,但这并不能解决
我有一个 Ext.tree.Panel,它有一个 TreeStore。这棵树在一个选项卡中。问题是,当我的应用程序加载应用程序中使用的所有树时,即使存储在 autoLoad: false 上,也会加载
我想创建 Ext.tree.TreePanel 组件并定期从外部 URl 加载内容。所以我写了类似的东西 new Ext.tree.TreePanel({ root: {
我是一名优秀的程序员,十分优秀!