$("#Grid").ejGrid({ … //To bind the autocomplete “focusIn” event, as soon as Grid is rendered dataBound: function (args) { var proxy = this; setTimeout(function (e) { $("#" + proxy.element.attr("id") + "_acString").ejAutocomplete({focusIn:"customFocusIn"}); }, 100); } }); function customFocusIn(args) { this.model.filterType = "endsWith"; } </script> |
$("#Grid").ejGrid({ allowFiltering: true, filterSettings: { filterType: "menu" }, allowScrolling: true, scrollSettings: { height: 300, allowVirtualScrolling: true, virtualScrollMode: ej.Grid.VirtualScrollMode.Normal }, dataSource: ej.DataManager({ url: "/Home/DataSource", adaptor: new ej.UrlAdaptor() }), columns: [ { field: "OrderID", isPrimaryKey: true, headerText: "Order ID" }, . . . . ], dataBound: function (args) { var proxy = this; setTimeout(function (e) { $("#" + proxy.element.attr("id") + "_acString").ejAutocomplete({ focusIn: function (args) { this.model.filterType = "StartsWith";//always suggest you startsWith word independent of the operator selected } }); }, 100); } |