|
@Html.EJ().DropDownList("Products_id").Datasource(ds => ds.URL("http://js.syncfusion.com/demos/ejServices/Wcf/Northwind.svc/")).Query("ej.Query().from('Customers').take(50)").DropDownListFields(f => f.Value("CustomerID").Text("CustomerID")).EnableServerFiltering(true).EnableFilterSearch(true).EnableIncrementalSearch(true).LoadOnDemand(true).AllowVirtualScrolling(true).ItemsCount(10) |
| @Html.EJ().DropDownList("Product").Datasource(ds => ds.URL("https://js.syncfusion.com/demos/ejServices/Wcf/Northwind.svc/Customers")).DropDownListFields(f => f.Value("CustomerID").Text("CustomerID")).EnableServerFiltering(true).EnableFilterSearch(true).EnableIncrementalSearch(true).LoadOnDemand(true).AllowVirtualScrolling(true).ItemsCount(2) |
Here are the screenshots:
Initially the list is empty:
After typing the filter string I get the error:
I have created a sample similar to what I'm using in my application. I tried with two different JSON outputs. Here are the screenshots:
The first output has the same result as your example, empty list and error:
The second JSON output initially gives the list with some results:
But filtering doesn't give any result:
Thanks,
Tom
| <td> @(Html.EJ().DropDownList("Customers2") .Datasource(ds => ds.URL("/DropDownList/CustomersDataSource2").Adaptor("UrlAdaptor")) .DropDownListFields(f => f.Value("CustomerID").Text("CustomerID")) .EnableServerFiltering(true) .EnableFilterSearch(true) .EnableIncrementalSearch(true) .LoadOnDemand(true) .AllowVirtualScrolling(true).ItemsCount(3) ) </td> <script> ej.DropDownList.prototype._filterSearch = function (searchQuery, args) { var flag = false; this.resultList = args.result.result ? args.result.result : ej.DataManager(this._rawList).executeLocal(searchQuery); if (this.resultList.length == 0) { flag = true; this.resultList.push(this._getLocalizedLabels("emptyResultText")); } this.popupListItems = this.resultList; this.ultag.empty(); this._isPlainType(this.popupListItems) ? this._plainArrayTypeBinding(this.resultList) : this._objectArrayTypeBinding(this.resultList, "search"); if (flag && this.ultag.find("li").length == 1) { this.ultag.find("li").eq(0).addClass("e-nosuggestion"); } if (this.model.showCheckbox && !flag) { this._appendCheckbox(this._getLi()); } this._onSearch = true; var value = this.value(), visibleText = this._visibleInput[0].value; this._setValue(this.value()); var checkVal = typeof this.model.value === "function" ? this.model.value() : this.model.value; if (checkVal != value) { this.element[0].value = value; this._visibleInput[0].value = visibleText; this.model.text = visibleText == "" ? null : visibleText; if (this.value() != value && !(this.value() == null && value == "")) { this._updateValue(value); } } this._onSearch = false; this._updateSelectedIndexByValue(this.value()); this._refreshScroller(); this._setListPosition(); } </script> |
| <table> <tr> <td> @(Html.EJ().DropDownList("Customers2") .Datasource(ds => ds.URL("/DropDownList/CustomersDataSource2").Adaptor("UrlAdaptor")) .DropDownListFields(f => f.Value("CustomerID").Text("CustomerID")) .EnableServerFiltering(true) .EnableFilterSearch(true) .EnableIncrementalSearch(true) .LoadOnDemand(true) .AllowVirtualScrolling(true).ItemsCount(3).ClientSideEvents(e => e.Search("onSearch")) ) </td> </tr> </table> <script> function onSearch(args) { this.model.itemsCount = 0 } ej.DropDownList.prototype._filterSearch = function (searchQuery, args) { var flag = false; this.resultList = args.result.result ? args.result.result : ej.DataManager(this._rawList).executeLocal(searchQuery); if (this.resultList.length == 0) { flag = true; this.resultList.push(this._getLocalizedLabels("emptyResultText")); } ……………………………. } </script> |