This is a migrated thread and some comments may be shown as answers.

filter grid with autocomplete help

1 Answer 310 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mirza
Top achievements
Rank 1
Mirza asked on 06 Jun 2013, 01:42 PM
Hi,
i have this code:

$("#grid_detail").kendoGrid({

    dataSource: {

        data: orders

    },

    filterable: {

        extra: false,

        operators: {

            string: {

                contains: "Contains",

            }

        }

    },

    sortable: true,

    columns: [

        {

            field: "Buyer",

            title: "buyer",

            width: "40"

        },

        {

            field: "name",

            title: "Article name",

            width: "40"

        },

        {

            field: "paid",

            title: "Paid",

            width: "20",

            filterable: false

        }

    ]

});


now, how can i filter on field buyer, but to use autocomplete, and to show all buyers that are in dataSource ?

I tried with this, on buyer filed, but still nothing.
filterable: function(element){
    element.kendoAutoComplete({
        dataSource: orders,
        dataTextField: "buyer",
    })
}

Any solution for this?


Thanks.

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 10 Jun 2013, 07:45 AM
Hi Mirza,

I am not sure what exactly you would like to do.

One option is to use filterable.ui to put AutoComplete inside the filter menu like in this example (please check "Title" column). This is useful when you would like to give opportunity to the user to filter on more than one column and with more than one operator.

Another option is to place the AutoComplete inside the Grid toolbar and filter the data manually on change of the AutoComplete. A similar scenario is demonstrated in this demo. The solution is suitable when you want to allow the user to filter only one field (buyer) and with only one operator (contains).

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Mirza
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or