Comments (2)
The data source is an Observable in order to support pagination, ordering, and filtering server side.
For example, i wrote a simple .NET library to support this ng2-ya-table.DataSource.Core.
Anyway, you can manage a simple array in this way:
public datasource: any = (request: any): Observable<any> => {
let page = (request.start / request.length) + 1;
return Observable.of({
recordsTotal: this.data.length,
recordsFiltered: this.data.length,
data: this.data.slice(request.length * (page - 1), request.length * page)
});
}
The example support only the pagination.
I'm looking to implement a built-in local datasource to also support filtering and sorting.
from ng2-ya-table.
The latest version now supports the local data source natively.
<ng2-ya-table [options]="options" [columns]="columns" [datasource]="data" [paging]="paging">
</ng2-ya-table>
public data: Array<any> = [...]; //array of data
from ng2-ya-table.
Related Issues (12)
- No styling out of the box HOT 2
- ngx-bootstrap missing HOT 1
- Column with dropdown menu HOT 2
- Dependency ngx-bootstrap is missing HOT 1
- language
- Error when getting data dynamically from another component using @Input HOT 1
- If I click on pagination the list disappear. HOT 2
- not working with electron HOT 2
- Button Double click HOT 2
- click event issue
- paging dropdown and filter not showing HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng2-ya-table.