2012-07-11 49 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%,但它仍指向同一个地方,当我们开始输入到它的输入框。 – 2012-07-11 13:45:27

+1

在该注释行下面添加以下行 found_existing_token.addClass(s​​ettings.classes.selectedToken); input_box.val(“”); – abhi 2012-07-12 05:35:31

+0

谢谢它解决了我的问题。 – 2012-07-12 05:37:32