We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

FIlter box with autocomplete

Thread ID:

Created:

Updated:

Platform:

Replies:

121329 Dec 2,2015 03:31 AM Dec 10,2015 12:53 AM JavaScript 3
loading
Tags: ejGrid
Stefano Enrico
Asked On December 2, 2015 03:31 AM

Hi,

i have a grid, with url adaptor, virtual scrolling and filterType = menu. 
When i type in the textbox, the autocomplete use the selected operator and not always the startswith or the contains operator. The operator dropdown would be use to filter the data in the grid and not the item list of aoutocomplete.

Can i change this behaviour?

Thanks
Regards
Stefano


Alan Sangeeth S [Syncfusion]
Replied On December 7, 2015 07:55 AM

Hi Stefano,

Thanks for using Syncfusion products.

We have achieved your requirement “AutoComplete suggestion operator must be specified exclusively and not from Filter Menu Dropdown” by using “focuIn” Autocomplete event. Please refer the following code example.

$("#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>



We have created a sample that can be downloadable from below link.
http://www.syncfusion.com/downloads/support/forum/121329/ze/EJGrid817178846

Regards,
Alan Sangeeth S

Stefano Enrico
Replied On December 9, 2015 05:48 AM

Hi,

I didn't explain it well. I don't want to set an operator on dropdown, but i want that the textbox "filter value" use the startWith operator, independently by selected operator. The selected operator will be use only to filter the grid data.


Thanks
Regards
Stefano

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On December 10, 2015 12:53 AM

Hi Stefano,

In our last update, we had suggested that you change the filterType for autocomplete suggestion to “endsWith”. In the focusin event of the ejAutocomplete, give the filterType as “StartsWith”, instead of “endsWith”, which will suggest the items independent of the operator selected from the dropdown. Please refer to the code example and screenshot.

$("#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);

            }
        });





We have prepared a sample with the above solution that can be downloaded from the following location.

http://www.syncfusion.com/downloads/support/forum/121329/ze/FilterMenu_MVC327453155

If we had misunderstood your query, please send the replication procedure. It will be helpful to analyze the issue and provide a solution as early as possible.

Regards,
Seeni Sakthi Kumar S.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;