1

I'm using Kendo UI Autocomplete with an ASMX Service which returns a string array like this :

<ArrayOfString>
    <string>One string</string>
    ...
</ArrayOfString>

All works fine except that the items list opens twice. One click close one list and the "second behind" is still open. When the list's opening we can see the second list opens behind the first.

Any idea ?

JS Code:

<input id="autoCompleteTest" />
<script>
    var dataSource = new kendo.data.DataSource({
        serverFiltering: true,
        transport: {
            read: {
                data: {
                    startswith: function(){
                        return $("#autoCompleteTest").data("kendoAutoComplete").value();
                    }
                },
                url: "WebService.asmx/GetStrings",
                type: "POST",
            }
        },
        schema: {
            // specify the the schema is XML
            type: "xml",
            // the XML element which represents a single data record
            data: "/ArrayOfString/string",
            // define the model - the object which will represent a single data record
            model: {
                // configure the fields of the object
                fields: {
                // the "title" field is mapped to the text of the "title" XML element
                value: "text()"
            }
        }
    }
});
$("#autoCompleteTest").kendoAutoComplete({
    minLength: 3,
    dataValueField : "value",
    dataTextField : "value",
dataSource: dataSource
});
</script>

C# Code:

[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public String[] GetStrings(string startswith)
{
    using (var dataContext = new DataClassesDataContext())
    {
        var query = from x in dataContext.product where x.shortName.StartsWith(startswith) select x.shortName;
        return query.ToArray();
    }
}
George
  • 36,413
  • 9
  • 66
  • 103
Nontenda
  • 185
  • 1
  • 13

2 Answers2

0

I've run into a similar issue and posted here

Please confirm that your autocomplete control is not located inside of another control that forces the Kendo control to render a second time.

Community
  • 1
  • 1
0

do you client code when dom is ready for kendo multiselect: $(document).ready(function () { ..yourcode.});

see: http://docs.telerik.com/kendo-ui/controls/editors/multiselect/overview#accessing-an-existing-multiselect

cahit beyaz
  • 4,829
  • 1
  • 30
  • 25