Tree table template can't seem to access rowData

UI Components for Angular
Post Reply
evanwellens
Posts: 2
Joined: 06 Jun 2016, 23:05

31 Oct 2016, 00:41

I must be doing something wrong , but I just don't see it . Hopefully someone has an easy answer ...
I have the following tree table defined and I get the name field , just not the status. It will render status if I just use a standard pcolumn no template so I know it sees the data. Knows the data field name . But all I get for that column is
status==

Code: Select all

p-treeTable [value]="floor" [style]="{'margin-bottom':'30px'}">
    <header>Stuff</header>
    <p-column field="name" header="Name"></p-column>
    <p-column field="status" header="Status">
        <template let-col let-row="rowData" pTemplate type="body">
            {{col.field}} == {{row[col.field]}}
        </template>
    </p-column>
</p-treeTable>
My component has a floors property such as

Code: Select all

        this.floor =[
            {
                "data": {
                    "name": "Officesx",
                    "status": "EFG",
                    
                },
                "children": [
                        {
                        "data": {
                            "name": "Johns Office",
                            "status": "EFG",
                            
                                },
                        },
                    {
                        "data": {
                            "name": "Fred's Office",
                            "status": "EFGX",
                            
                        },
                        
                    }
                ]
            },
            {
                "data": {
                    "name": "Hallways",
                    "status": "EFG",
                    
                },
                "children": [
                    {
                        "data": {
                            "name": "Rear",
                            "status": "xxx",
                            
                        }
                    },
                    {
                        "data": {
                            "name": "Front",
                            "status": "zzz",
                            
                        }
                    },
                    {
                        "data": {
                            "name": "Center",
                            "status": "qqq",
                            
                        }
                    }
                ]
            }
        ]
                
Dependencies I'm using

Code: Select all

"dependencies": {
    "@angular/common": "~2.1.0",
    "@angular/compiler": "~2.1.0",
    "@angular/core": "~2.1.0",
    "@angular/forms": "~2.1.0",
    "@angular/http": "~2.1.0",
    "@angular/platform-browser": "~2.1.0",
    "@angular/platform-browser-dynamic": "~2.1.0",
    "@angular/router": "~3.1.0",
    "@angular/upgrade": "~2.1.0",

    "angular-in-memory-web-api": "~0.1.5",
    "bootstrap": "^3.3.7",
    "systemjs": "0.19.39",
    "core-js": "^2.4.1",
    "reflect-metadata": "^0.1.8",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "^0.6.25",
    "primeng": "1.0.0-beta.17",
    "primeui": "4.1.15"

  }
I'm stumped..

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests