我的树形网格看起来像这样:
但开头也有一个空文件夹。我不希望它在那里。那么我的json有什么问题:
{
"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 崩溃并出现此错误:递归过多和/或它将再次显示所有叶子:
我是在建筑师那里做的,所以也许也有问题。我做错了什么?
干杯