Telerik MVC Combobox AutoComplete error

Posted by Roachmans on Stack Overflow See other posts from Stack Overflow or by Roachmans
Published on 2010-10-12T10:10:43Z Indexed on 2011/03/01 15:25 UTC
Read the original article Hit count: 619

Filed under:
|

I am using the Telerik autocomplete option

In the header:

<script type="text/javascript">
function onAutoCompleteDataBinding(e) {
  var autocomplete = $('#AutoComplete').data('tAutoComplete');
  autocomplete.dataBind(["Product 1", "Product 2", "Product 3"]}
</script>

In the body of the View:

<%=Html.Telerik().AutoComplete()
  .Name("AutoComplete")
  .ClientEvents(events => events.OnDataBinding("onAutoCompleteDataBinding"))
%>

http://demos.telerik.com/aspnet-mvc/combobox/clientsidebinding

I have managed to get this working on other applications and it is really quite simple. I have pasted this example on top to show that this one also bombs out on :

 this.trigger = new $t.list.trigger(this);

Think i might have mixed up the .js files and now my auto complete is not working. Any sugesions which js files and in what order they must be for this to work right

My Page master relevant parts:

<body>
    <% Html.Telerik().ScriptRegistrar()
            .DefaultGroup(group => group
                .Add("MicrosoftAjax.js")
                .Add("MicrosoftMvcAjax.js")
            );
    %>
        <div class="MainTableBody">
            <asp:ContentPlaceHolder ID="ContentPlaceHolder" runat="server" />
        </div>

    <% Html.Telerik().ScriptRegistrar().Render(); %>
</body>
</html>

In my web.config

<add namespace="Telerik.Web.Mvc.UI" />

Any help or comments would be greatly appreciated

© Stack Overflow or respective owner

Related posts about mvc

Related posts about telerik