仅限Chrome中的KendoAutoComplete问题

时间:2016-01-27 08:10:40

标签: jquery

enter image description here

enter image description here

当我输入任何用户名时,它显示上面的错误。但是当我们在firefox和Internet Explorer中打开它时,它工作正常。以下是我的代码

 function GetActiveEmployeeNames() {
        //debugger;
        $.ajax({
            type: "POST",
            url: "VerveWall.aspx/GetActiveEmployeeNames",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
                OnSucceeded(response.d, null, null);
            },
            failure: function (response) {
                //alert(response);
            }
        });
    }

调用以下函数

 var source = [];
    function OnSucceeded(result, userContext, methodName) {
        //debugger;
        //source = "";
        if (result.length > 0) {
            if (source.length < 1) {
                for (var i = 0; i <= result.length - 1; i++) {
                    source.push({
                        "empId": result[i].Id,
                        "employeeName": result[i].Employee_Name,
                        "firstName": result[i].FirstName,
                        "middleName": result[i].MiddleName,
                        "lastName": result[i].LastName,
                        "photographFileName": result[i].PhotographFileName
                    });
                }
            }
        }
        bindPost();            
    }

并调用bindPost函数

  function bindPost() {
        //debugger;
        var highlight_users = new Array();
        $("#<%=txtPostMessage.ClientID%>").kendoAutoComplete({
            separator: " ",
            filter: "contains",
            dataTextField: "employeeName",
            dataSource: source,
            minLength: 3,
            placeholder: "What's on your mind...",
            template: '<img src="upload/Photograph/${data.photographFileName}" width=30 height=30/>&nbsp;${data.employeeName}',
            height: 370,
            select: function (data) {
                tagging_users.push(data.empId);
                highlight_users.push(data.firstName);
                highlight_users.push(data.lastName);

                $("#<%=txtPostMessage.ClientID%>").highlightTextarea('enable');
                jQuery("#<%=txtPostMessage.ClientID%>").highlightTextarea({
                    words: highlight_users,
                    color: "#aacccc"
                });
            }

        }).data("kendoAutoComplete");

    }

1 个答案:

答案 0 :(得分:0)

您使用的是什么版本的剑道? 如果从2012年开始更新,您将需要更新您的jQuery 见Kendo UI prerequisites