akveo / akveo/ng2-smart-table

SeverDataSource not fetching rows.

未關閉
#691 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
1.6k
分支
867
PR 合併指標
30 天內沒有已合併 PR

描述

Edit:
it seems that when changing from templateUrl to template the server data source works.

For some reason, my serverdatasource won't fetch rows from the DB.
the api code returns an array of objects.
the exact same query works with LocalDataSource if i fetch the rows manually.

I have a serverdatasource defined as such:

```
@Component({
templateUrl: 'dashboard.component.html'
})

export class DashboardComponent {
source: ServerDataSource;

settings = {
columns: {
Timestamp: {
title: 'TimeStamp'
},
Machine: {
title: 'Machine'
},
Severity: {
title: 'Severity'
},
Status: {
title: 'Message'
},
info: {
title: '',
type: 'custom',
renderComponent: ButtonViewComponent,
onComponentInitFunction(instance) {
instance.save.subscribe(row => {
alert(`${row.Machine} saved!`)
});
},
filter: false
},
}
};

constructor(private http: Http) {
this.source = new ServerDataSource(this.http, {endPoint: `https://localhost/Log?amount=20`});
}
```

And my html template as such:

```




Latest Events






```

Can anyone tell me what is the problem ?

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。