akveo / akveo/ng2-smart-table

Catching loading event

Abierto
#784 9 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
1.6k
Forks
867
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hello,
I want to make a spinner indicating data being refreshed. But how can I catch event for data being loaded?

Im getting data this way:
```
this.source = new ServerDataSource(http, { endPoint: 'https://jsonplaceholder.typicode.com/photos' });
```

I tried to user LocalDataSource, and manually getting data on "onSearch":
```
getData(modifiedData?) {
this.loading = true;
let sourceCopy = modifiedData ? modifiedData : this.source;
let requestData = {
filter: sourceCopy.getFilter(),
paging: sourceCopy.getPaging(),
sort: sourceCopy.getSort()
}
this.service.getData(requestData).then((data) => {
this.source.load(data);
this.loading = false;
});
}
```
This works for search input, but this way I'd have to write pagination component on my own, while the stock one is just fine.

Any ideas?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.