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

Windows Authentication on IE8: Json Web Service --> DataSource --> AutoComplete

1 Answer 52 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Matt Meisinger
Top achievements
Rank 1
Matt Meisinger asked on 26 Jan 2012, 07:31 PM
I encountered an error when attempting to configure an AutoComplete data source on an Intranet web site.  The site uses Windows Authentication (ASP.Net MVC3).  The AutoComplete only loaded data 1/10 of the time (roughly).  Otherwise it would flicker a little, but no data would appear.  Works fine in Chrome.

There is only one workaround that I found that made it work 100% of the time: Force IE-7 compatibility mode in the HTML. That workaround is not preferable.

Any ideas?

UPDATE: Removed references to a second workaround, which on further testing did not end up working.

Here's my HTML:

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=8" />
        <title>New Project</title>
        <script type="text/javascript" src="/Scripts/jquery-1.7.1.min.js"></script>
        <script type="text/javascript" src="/Scripts/kendo.all.min.js"></script>
        <link type="text/css" href="/Content/kendo.common.min.css" rel="stylesheet"/>
        <link type="text/css" href="/Content/kendo.custom.min.css" rel="stylesheet"/>
    </head>
    <body>
        <input id="ContactDescription" name="ContactDescription" type="text" value="" />
        
        <script type="text/javascript">
            $(document).ready(function () {
                var contactAutoCompleteDataSource = new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: "/Ajax/EmployeesList",
                            dataType: "json",
                            data: {
                                showAll: function () {
                                    return $('#showAll').is(':checked');
                                }
                            }
                        }
                    },
                    change: function (e) {
                        //alert('Total records: ' + contactAutoCompleteDataSource.total()); // This displays ~500
                    }
                });
                $('#ContactDescription').kendoAutoComplete({
                    minLength: 2,
                    filter: "contains",
                    dataTextField: "title",
                    dataSource: contactAutoCompleteDataSource
                });
                $('#showAll').click(function (e) {
                    contactAutoCompleteDataSource.read();
                });
            });
        </script>
    </body>
</html>

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 27 Jan 2012, 09:44 AM
Hi,

 Your configuration is not using server filtering which means that the autocomplete will hit the service only one time. If you want the service to be hit every time you should enable server filtering:

              var contactAutoCompleteDataSource = new kendo.data.DataSource({
                    serverFiltering: true,
                    transport: {
                        read: {
                            url: "/Ajax/EmployeesList",
                            dataType: "json",
                            data: {
                                showAll: function () {
                                    return $('#showAll').is(':checked');
                                }
                            }
                        }
                    },
                    change: function (e) {
                        //alert('Total records: ' + contactAutoCompleteDataSource.total()); // This displays ~500
                    }
                }); 

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Matt Meisinger
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or