在角度6中,我安装了ng-treetable,并且在列中必须读取一个true或false数组。根据结果,我应该将图像放在列中。在周围的小文档上,我什么都没找到
html:
<ay-treeTable [value]="TREETABLE" [globalFilter]="gb" [rows]="10"
[pageLinks]="3" [rowsPerPageOptions]="[5,10,20]">
<ay-column field="name" header="Name"></ay-column>
<ay-column field="datiispezione" header="Dati ispezione"></ay-column>
<ay-column field="rapporto" header="rapporto"></ay-column>
<ay-column field="riferimenti" header="riferimenti"></ay-column>
</ay-treeTable>
JSON示例:
export const TREETABLE: Array<Object> = [
{
"data": {
"name": "Andrew",
"datiispezione": {
"view": true,
"edit": false
},
"rapporto": {
"view": true,
"edit": false
},
"riferimenti": {
"view": true,
"edit": false
}
},
"children": [
{
"data": {
"name": "Andrewson",
"datiispezione": {
"view": true,
"edit": false
},
"rapporto": {
"view": true,
"edit": false
},
"riferimenti": {
"view": true,
"edit": false
}
},
"children": [
{
"data": {
"name": "Eric",
"datiispezione": {
"view": true,
"edit": false
},
"rapporto": {
"view": true,
"edit": false
},
"riferimenti": {
"view": true,
"edit": false
}
}
}
]
}
]
},
{
"data": {
"name": "Andrew",
"datiispezione": {
"view": true,
"edit": false
},
"rapporto": {
"view": true,
"edit": false
},
"riferimenti": {
"view": true,
"edit": false
}
},
"children": [
{
"data": {
"name": "Andrewson",
"datiispezione": {
"view": true,
"edit": false
},
"rapporto": {
"view": true,
"edit": false
},
"riferimenti": {
"view": true,
"edit": false
}
},
"children": [
{
"data": {
"name": "Eric",
"datiispezione": {
"view": true,
"edit": false
},
"rapporto": {
"view": true,
"edit": false
},
"riferimenti": {
"view": true,
"edit": false
}
}
}
]
}
]
}
]
我尝试了此方法,但是它不起作用:
<ay-column field = "data inspection [0]" header = "Inspection data">
</ ay-column>