Primeng: TreeTable must export SharedModule

Created on 11 Jul 2018  路  18Comments  路  Source: primefaces/primeng

in my component ts:
treeNodes: TreeNode[];

constructor(){
this.treeNodes = [
{
"data": [
{
"label": "Documents",
"data": "Documents Folder",
"expandedIcon": "fa-folder-open",
"collapsedIcon": "fa-folder",
"children": [{
"label": "Work",
"data": "Work Folder",
"expandedIcon": "fa-folder-open",
"collapsedIcon": "fa-folder",
"children": [{
"label": "Expenses.doc",
"icon": "fa-file-word-o",
"data": "Expenses Document"
}, {
"label": "Resume.doc",
"icon": "fa-file-word-o",
"data": "Resume Document"
}]
},
{
"label": "Home",
"data": "Home Folder",
"expandedIcon": "fa-folder-open",
"collapsedIcon": "fa-folder",
"children": [{
"label": "Invoices.txt",
"icon": "fa-file-word-o",
"data": "Invoices for this month"
}]
}]
},
{
"label": "Pictures",
"data": "Pictures Folder",
"expandedIcon": "fa-folder-open",
"collapsedIcon": "fa-folder",
"children": [
{
"label": "barcelona.jpg",
"icon": "fa-file-image-o",
"data": "Barcelona Photo"
},
{
"label": "primeui.png",
"icon": "fa-file-image-o",
"data": "PrimeUI Logo"
}]
}
]
}
]
}

html:

FileSystem Name description Action {{rowData.label}} {{rowData.data}}

Nothing show in my browser page, Help me please

defect

Most helpful comment

I have the same issue with angular 6.0.9 and primeNG 6

All 18 comments

image

Hello @klower , which version of PrimeNG are you using?
Try to upgrade to the latest PrimeNG version (6.0.0)

@gbourant l use the version:
"primeng": "^6.0.0-beta.1",
"primeicons": "^1.0.0-beta.9"

Alright, i had the same issue with the tree table component at 6.0.0-beta.1 version.
Upgrading to version 6.0.0 should resolve the issue.

@gbourant I have changed the version:
"primeng": "^6.0.0",
"primeicons": "^1.0.0-beta.9"

but the issue is exist all the same

1) Did you run npm install after you changed PrimeNG version?
2) Try the example from the documentation here, it should work.

@gbourant yes, I have tried many times, but cannot solve this problem

@gbourant l have test the demo data:
this.treeNodes = [
{
"data":{
"name":"Documents",
"size":"75kb",
"type":"Folder"
},
"children":[
{
"data":{
"name":"Work",
"size":"55kb",
"type":"Folder"
},
"children":[
{
"data":{
"name":"Expenses.doc",
"size":"30kb",
"type":"Document"
}
},
{
"data":{
"name":"Resume.doc",
"size":"25kb",
"type":"Resume"
}
}
]
},
{
"data":{
"name":"Home",
"size":"20kb",
"type":"Folder"
},
"children":[
{
"data":{
"name":"Invoices",
"size":"20kb",
"type":"Text"
}
}
]
}
]
},
{
"data":{
"name":"Pictures",
"size":"150kb",
"type":"Folder"
},
"children":[
{
"data":{
"name":"barcelona.jpg",
"size":"90kb",
"type":"Picture"
}
},
{
"data":{
"name":"primeui.png",
"size":"30kb",
"type":"Picture"
}
},
{
"data":{
"name":"optimus.jpg",
"size":"30kb",
"type":"Picture"
}
}
]
}
]

image

also this issue not be fixed

facing exact same issue :|

@gbourant, would you please help us?

and my package.json:
image

Seems your dependencies are wrong , check this package.json

@gbourant , you mean I should use the angular version 6.0.4?

Yes, use Angular 6.0.4 and PrimeNG 6.

l have changed the angular version to 6.0.4, but the issue not be fixed:
{
"name": "angular2-demo-proj",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.0.4",
"@angular/common": "^6.0.4",
"@angular/compiler": "^6.0.4",
"@angular/core": "^6.0.4",
"@angular/forms": "^6.0.4",
"@angular/http": "^6.0.4",
"@angular/platform-browser": "^6.0.4",
"@angular/platform-browser-dynamic": "^6.0.4",
"@angular/router": "^6.0.4 ",
"angular-in-memory-web-api": "^0.4.6",
"bootstrap": "^4.1.1",
"core-js": "^2.4.1",
"primeicons": "^1.0.0-beta.9",
"primeng": "6.0.0",
"rxjs": "^6.2.0",
"rxjs-compat": "^6.2.0",
"save": "^2.3.2",
"zone.js": "^0.8.19"
},
"devDependencies": {
"@angular/cli": "~1.7.3",
"@angular/compiler-cli": "^6.0.4",
"@angular/language-service": "^6.0.4",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.7.2"
}
}

I have the same issue with angular 6.0.9 and primeNG 6

I have recently upgraded my angular and primeng to 6.0.7 and 6.0 respectively. New primeng is not supporting old treetable? its not displaying tree table at all, where as p-datatable is still working with primeng 6.0.

Is the code for old tree-table is removed from primeng 6.0 code base??

I just encountered this issue. I have a lazy loaded module with a component that uses the treeTable. I had to add the prime SharedModule as an import too. Once added it all showed correctly.

Update:
Primeng table doesn't have this problem because it also exports SharedModule .

Looks like TreeTable should also export this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Faigjaz picture Faigjaz  路  3Comments

Helayxa picture Helayxa  路  3Comments

gatapia picture gatapia  路  3Comments

pchristou picture pchristou  路  3Comments

philly-vanilly picture philly-vanilly  路  3Comments