Extjs 如何删除树网格中的空文件夹
我的树丛看起来像这样: 但在开始时还有一个空文件夹。我不想让这件事发生。那么,我的json有什么问题:Extjs 如何删除树网格中的空文件夹,extjs,treegrid,Extjs,Treegrid,我的树丛看起来像这样: 但在开始时还有一个空文件夹。我不想让这件事发生。那么,我的json有什么问题: { "children": [ { "type": "Videotechnicus", "prijs": "35", "children": [ { "id": 52, "uren": "09:00:00", "aan
{
"children": [
{
"type": "Videotechnicus",
"prijs": "35",
"children": [
{
"id": 52,
"uren": "09:00:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 0,
"type": "Laden",
"leaf": true
},
{
"id": 53,
"uren": "10:00:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 1,
"type": "Reizen",
"leaf": true
},
{
"id": 54,
"uren": "11:30:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 1,
"type": "Bouwen",
"leaf": true
},
{
"id": 55,
"uren": "12:30:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 0,
"type": "Lunch",
"leaf": true
},
{
"id": 56,
"uren": "16:00:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 1,
"type": "Plenair live",
"leaf": true
},
{
"id": 57,
"uren": "17:00:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 1,
"type": "Afbouw",
"leaf": true
},
{
"id": 58,
"uren": "18:00:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 1,
"type": "Terugreis",
"leaf": true
},
{
"id": 59,
"uren": "19:00:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 0,
"type": "Uitladen",
"leaf": true
}
],
"leaf": false
},
{
"type": "Cameraman",
"prijs": "45",
"children": [
{
"id": 52,
"uren": "09:00:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 0,
"type": "Laden",
"leaf": true
},
{
"id": 53,
"uren": "10:00:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 1,
"type": "Reizen",
"leaf": true
},
{
"id": 54,
"uren": "11:30:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 1,
"type": "Bouwen",
"leaf": true
},
{
"id": 55,
"uren": "12:30:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 0,
"type": "Lunch",
"leaf": true
},
{
"id": 56,
"uren": "16:00:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 1,
"type": "Plenair live",
"leaf": true
},
{
"id": 57,
"uren": "17:00:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 1,
"type": "Afbouw",
"leaf": true
},
{
"id": 58,
"uren": "18:00:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 1,
"type": "Terugreis",
"leaf": true
},
{
"id": 59,
"uren": "19:00:00",
"aanwezig": 1,
"bedrag": 100,
"totaal": 100,
"factureren": 0,
"type": "Uitladen",
"leaf": true
}
],
"leaf": false
}
]
}
或与我的商店:
Ext.define('MyApp.store.opdrachtPersoneelTree', {
extend: 'Ext.data.TreeStore',
alias: 'store.opdrachtPersoneelTree',
requires: [
'MyApp.model.personeelOfferteTree'
],
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
autoLoad: true,
model: 'MyApp.model.personeelOfferteTree',
storeId: 'opdrachtPersoneelTree',
nodeParam: 'type',
proxy: {
type: 'ajax',
url: 'json/opdrachtpersoneel.php',
reader: {
type: 'json'
}
}
}, cfg)]);
}
});
Ext.define('MyApp.model.personeelOfferteTree', {
extend: 'Ext.data.Model',
fields: [
{
name: 'type'
},
{
name: 'uren'
},
{
name: 'aanwezig'
},
{
name: 'bedrag'
},
{
name: 'totaal'
}
]
});
那里还有一只虫子。当我关闭“Cameraman”时,我的firefox崩溃并出现以下错误:递归太多和/或它将再次显示所有叶:
我是在architect中制作的,所以可能也有问题。我做错了什么
干杯这实际上是两个问题,为了回答标题提出的问题,第一个节点不是一个真正的空文件夹(至少不在您提供的图片中),它实际上是顶级根,要隐藏它,只需设置:
rootVisible:false
在给出解释之前,我必须进一步研究递归问题-您可能想将其拆分为另一个问题,因为鉴于当前的标题,您可能无法吸引那些能够为您回答的人。rootVisible正是我想要的,谢谢!我编辑问题,不是最好的方式对不起:(因此未来的用户查看一个内聚线程/问题/答案时,您应该将有关递归问题的问题分离为一个新问题,而不是更改问题本身