2016-01-27 84 views
2

enter image description hereKendoAutoComplete問題僅

enter image description here

當我的時候,我們在Firefox和Internet Explorer中打開它輸入任何用戶名,然後它顯示這個上面error.but它工作正常。下面是我的代碼

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"); 

    } 

回答

0

你用什麼版本的劍道? 如果有更新,然後從2012年一年,你將需要更新您的jQuery 見Kendo UI prerequisites

+0

劍道UI v2011.3.1413 –

+0

請投我的問題如果u喜歡,這樣我可以贏得聲譽 –