Hi,
Thank you for your answer. I have one more question.
I need to implement filtering on ejlistbox with virtual scrolling. Filtering should be done by words inserted by the users in a text box. When the text box loses focus, I need to fetch the data from the server with that filter, and refresh the listbox. I have problem how to refresh the list box after the new data are fetched from the server.
The backend is ASP.NET WebAPI service.
Thank you in advacne,
Ivana
<input type="text" id="txtFilter" onblur="onfilterData()" />
function onfilterData() {
var lb = $("#selectcustomer").data("ejListBox");
var filter = $("#txtFilter").val();
dataManger = ej.DataManager({ url: 'http://js.syncfusion.com/ejServices/wcf/NorthWind.svc/', crossDomain: true });
query = ej.Query().from('Customers').where("CustomerID", "contains", filter, false);;
var execute = dataManger.executeQuery(query) // executing query
.done(function (e) {
var tmpresult = e.result;
if (tmpresult.length != 0) {
lb.setModel({ dataSource: tmpresult });
lb.refresh();
}
else
lb.setModel({ dataSource: null });
});
}
|
Hello,
I have some issue with the datamanager url in ejlistbox. The problem is that all of a sudden , new parameter is added in the url, $inlinecoun=allPages.
Maybe it's because of the Syncfusion version. Are there some changes in the latest version for this component?
Now I get the following error:
Hello,
I have problem with fetching data in syncfusion list box with virtual scrolling (continuous).
If I scroll very fast the requests for fetching new data are not sent in correct order and error is displayed in browser console.(shown in the attachment).
Note: These are the list box options/properties:
this.listBoxOptions = {
width: "100%",
showCheckbox: true,
allowDrag: false,
allowDrop: false,
allowMultiSelection: true,
dataSource: this.datamanager,
fields: { text: "name", value:
"name", id: "id" },
allowVirtualScrolling: true,
virtualScrollMode: "continuous",
objectRef: this.refType,
itemRequestCount: 10,
itemsCount: 7
}
Where datamanager is :
this.datamanager = new ej.DataManager({
url: configuration.api + "api/users/multiplePaged",
crossDomain: true
});
What should I do ?
Ivana
Hello,
Thank you for the examples, the provided information was helpful.
But I found there is still one issue with the combination of filtering and virtual scrolling. After filter function is called and setModel is executed, the list is populated with new data (filtered data), but now virtual scrolling is not working. The list box component is populated with all data after onFilterData is called.
Please help me,
Ivana
<input type="text" id="txtFilter" onblur="onfilterData()" />
function onfilterData() {
var lb = $("#selectcustomer").data("ejListBox");
var filter = $("#txtFilter").val();
dataManger = ej.DataManager({ url:'http://js.syncfusion.com/ejServices/wcf/NorthWind.svc/', crossDomain: true });
query = ej.Query().from('Customers').where("CustomerID", "contains", filter, false);;
var execute = dataManger.executeQuery(query) // executing query
.done(function (e) {
var tmpresult = e.result;
if (tmpresult.length != 0) {
lb.setModel({ dataSource: dataManger , query: query });
lb.refresh();
}
else
lb.setModel({ dataSource: null });
});
}
|
HI,
Thank you for your answer. The provided information was helpful, but there is still an issue with virtual scrolling. (see the attachment)
That happens after applying filter (setting the datasource and the query with setModel as you proposed) and then scroll down in the list to the end.
How can I stop the requests to server, when there is no more data to be fetched? What should I send as response form server in order the listbox to be aware there is no more data to be fetched from server?
Thank you in advance,
Ivana