BoldDesk®Customer service software offering ticketing, live chat, and omnichannel support, starting at $49/mo. for 10 agents. Try it for free.
public onOpen(args){
let start: number = 7;
let end: number = 12;
let listElement: HTMLElement = (this.multiselectObj as any).list;
listElement.addEventListener('scroll', () => {
if ((listElement.scrollTop + listElement.offsetHeight >= listElement.scrollHeight)) {
let filterQuery = this.multiselectObj.query.clone();
this.data.executeQuery(filterQuery.range(start, end)).then((event: any) => {
start = end;
end += 5;
this.multiselectObj.addItem(event.result as { [key: string]: Object }[]);
}).catch((e: Object) => {
});
}
})
}
|
public getData(data) {
if(data === "load"){
this.state.take = this.state.take + 10;
this.state.skip = this.state.skip + 10;
}
const skipquery = this.state.skip ? `$skip=${this.state.skip}` : null;
let pageQuery = "";
const takeQuery = this.state.take ? `$top=${this.state.take}` : null;
if (skipquery) {
pageQuery = `${skipquery}&`;
}
if (takeQuery) {
pageQuery = `${pageQuery}${takeQuery}`;
}
this.data = this.http
.get(`${this.BASE_URL}?${pageQuery}&$count=true`)
.pipe(
map(data => {
return (<any>data).value;
})
);
}
// bind the Query instance to query property
// maps the remote data column to fields property
public remoteFields: Object = { text: "CustomerID", value: "CustomerID" };
// set the placeholder to MultiSelect input element
public remoteWaterMark: string = "Select names";
public onOpen(args) {
let start: number = 7;
let end: number = 12;
this.state.skip = this.state.skip + 10;
this.state.take = this.state.take;
let listElement: HTMLElement = (this.multiselectObj as any).list;
listElement.addEventListener("scroll", () => {
if (
listElement.scrollTop + listElement.offsetHeight >=
listElement.scrollHeight
) {
this.getData("load");
}
});
}
}
|