2016-10-26 2 views
-1

필자는 제안한 커스텀 렌더러를 만들고있다. 내가 currenctly이 코드로 반환 항목을 무시할 수 있어요 :커스텀 렌더 태그 -Y 플러그인

$projectTags.tagit({ 
      autocomplete: ({ 
       delay: 0, 
       minLength: 2, 
       source: test, 
       select: function (event, ui) { 
        that.createTag(ui.item.value); 
        // Preventing the tag input to be updated with the chosen value. 
        return false; 
       } 

      }) 
     }); 

     $projectTags.find("input").data("uiAutocomplete")._renderItem = function (ul, item) { 
      var newItem = $("<li class='project-tagit-li'>"); 
      var color = $.string_to_color(item.OwnerName); 
      var initials = item.OwnerName.split(" ")[0][0] + item.OwnerName.split(" ")[1][0]; 
      newItem.attr("data-value", item.OwnerId); 

      var html = '<p class="initials initials-project-tagit" title="' + item.OwnerName + '" style="background-color:' + color + '" >' + initials + '</p><div><p class="projectName">' + item.Name + '</p><p class="companyName">' + item.CompanyName + '</p></div>'; 

      newItem.append(html) 
      return newItem.appendTo(ul); 
     }; 

문제는 모든 이벤트에 의해 바인더 제본 있다는 것입니다 태그 내 자신의 항목을 사용할 수 없습니다. 누군가 다시 아이디어를 바인딩 할 생각이 있습니까?

리튬은 <a>하고

을 사용자 지정 개체가있는 경우 item.label & 값이없는 비어 있어야이 필요합니다 :

답변

0

나는 해결책을 찾을 수