Below is the textbook data provider definition:
dataProvider: {
notify: true,
value: () => {
const _this = this;
return (params, callback) => {
const items = Array.apply(null, {length: params.pageSize})
.map((item, index) => getJSON('http://randomuser.me?index=' + (index + params.page * params.pageSize)));
_this.loading = true;
setTimeout(() => {
callback(items);
_this.loading = false;
}, _this.delay);
};
}
}
in x-data-provider.html
from [here]
(https://github.com/vaadin/vaadin-grid/blob/master/demo/x-data-provider.html).
The basic data provider fetches data when pageSize/filter/Sort properties change. In my case I have a dropdown on whose selection the vaadin grid is populated (the user can select different items and on each item there is new data in the grid). At the moment I am unable to call the the data provider whenever the user changes the drop down value.
Use Case:
Fetch Data from server when filter and sort order changed. Fetch data from server when user changes data source
meaning value from drop down.
Is this possible?