I'm just following the demo to show a simple datatable. Here is my code:
columns = [
{name: 'ID', prop: 'id'},
{name: 'Street Address', prop: 'address.street'},
{name: 'Suburb', prop: 'address.suburb'},
{name: 'State', prop: 'address.state'},
{name: 'Manager Name', prop: 'manager.name'},
{name: 'Manager Company', prop: 'manager.company'},
];
<ngx-datatable #table
class = 'material striped'
[columns] = "columns"
[rows] = "rows | async"
[footerHeight] = "25" >
</ngx-datatable>
Sorting does work but, I'm also getting this error when I click on a column to sort the records:
I get rows as Observable from Firestore.
import {Observable} from 'rxjs/Observable';
Just this – Northeastangularfire2
to get data and store itssnapshot
in anobservable
, which i then pass to rows. – NortheastDataTableHeaderComponent.html
– NortheastngOnInit() { this.propertyService .valueChnages() .subscribe(properties => this.rows = properties); }
Just like this. – NortheastfromEvent
in yourLongPressDirective
? – SnowmanLongPressDirective
. i just copy and pasted the most basic example to create a simple datatable. – Northeast