2012-07-11 1 views
1

yii tokeninput 확장에 문제가 있습니다. 나는 이름을 검색 할 때 사용자 목록을 제공하고 이름을 선택하고 그 이름이 선택된 항목 뒤의 커서 위치보다 이전에 선택되면 입력 상자의 모든 항목의 끝을 가리 키지 않습니다.yii tokeninput 확장 커서 동일한 일치 후 잘못된 위치에 초점을?

이 구성을 사용하고 있습니다.

$this->widget('ext.tokeninput.TokenInput', array(
     'model' => $model, 
     'attribute' => 'USER_ID', 
     'url'=>$this->createUrl('user/searchUserNames'), 
     'options' => array(
      'allowCreation' => false, 
      'preventDuplicates' => true, 
      // 'resultsFormatter' => 'js:function(item){ return “<li><p>” + item.name + “</p></li>” }', 
      'theme' => 'facebook', 
      //'hintText' => 'Type', 
      'prePopulate' => $prePopulate, 
      'processPrePopulate' => $processPrePopulate, 

     ) 
    )); 

또한 예제를 살펴 보았지만 해결책을 찾지 못했습니다. 아무도 나를 도울 수 있습니까? Loopj: jquery token input demo

답변

1
plz comment the line number 509 in **jquery.tokeninput.js** 
    input_token.insertAfter(found_existing_token); 
    that line insert cursor after that selected item so if you comment 
    this line cursor is at the end of all names 
+0

그것은 문제의 50 %를 해결하지만 우리는 입력 상자 여기에 입력을 시작하면 여전히 같은 장소를 가리 킵니다. –

+1

주석 처리 된 행 아래에 다음 행을 추가하십시오. found_existing_token.addClass (settings.classes.selectedToken); input_box.val (""); – abhi

+0

덕분에 내 문제가 해결되었습니다. –

관련 문제