2013-06-21 10 views
5
$("#responsible").tokenInput(
      [ 
       {id: 7, name: "[email protected]"}, 
       {id: 11, name: "[email protected]"}, 
       {id: 13, name: "[email protected]"}, 
       {id: 17, name: "[email protected]"}, 
       {id: 19, name: "[email protected]"}, 
       {id: 23, name: "[email protected]"}, 
       {id: 29, name: "[email protected]"}, 
       {id: 31, name: "[email protected]"} 
      ],{ 
       prePopulate: respArray, 
       hintText: "Enter mailid", 
       allowCustomEntry: true, 
       theme : "facebook", 
       noResultsText: "O noes", 
       searchingText: "Searching...", 
       minChars: 1, 
       tokenLimit: 1, 
       tokenValue: "name", 
       preventDuplicates: true 
      } 
); 
  1. トークン入力は、カスタム項目のために働いていないプラグインのjQueryのトークンの入力で動作していません。カーソルが入力から出てすぐに、テキストは入力から消えます。どうすればこの問題を解決できますか? @Cindrellaと
+3

https://github.com/loopj/jquery-tokeninput 1.6.1 versio try allowFreeTagging:trueオプションです。 – Cindrella

答えて

3

テスト:

$("#responsible").tokenInput(
     [ 
      {id: 7, name: "[email protected]"}, 
      {id: 11, name: "[email protected]"}, 
      {id: 13, name: "[email protected]"}, 
      {id: 17, name: "[email protected]"}, 
      {id: 19, name: "[email protected]"}, 
      {id: 23, name: "[email protected]"}, 
      {id: 29, name: "[email protected]"}, 
      {id: 31, name: "[email protected]"} 
     ],{ 
      prePopulate: respArray, 
      hintText: "Enter mailid", 
      allowCustomEntry: true, 
      theme : "facebook", 
      noResultsText: "O noes", 
      searchingText: "Searching...", 
      minChars: 1, 
      tokenLimit: 1, 
      tokenValue: "name", 
      allowFreeTagging: false, // !ADD THIS ! 
      preventDuplicates: true 
     } 
); 
0

これを試してください:あなたが開始したときに真:

$("#responsible").tokenInput(
    [ 
    {id: 7, name: "[email protected]"}, 
    {id: 11, name: "[email protected]"}, 
    {id: 13, name: "[email protected]"}, 
    {id: 17, name: "[email protected]"}, 
    {id: 19, name: "[email protected]"}, 
    {id: 23, name: "[email protected]"}, 
    {id: 29, name: "[email protected]"}, 
    {id: 31, name: "[email protected]"} 
    ],{ 
    prePopulate: respArray, 
    hintText: "Enter mailid", 
    allowFreeTagging: true, 
    theme : "facebook", 
    noResultsText: "O noes", 
    searchingText: "Searching...", 
    minChars: 1, 
    tokenLimit: 1, 
    tokenValue: "name", 
    preventDuplicates: true 
} 
); 

allowFreeTaggingを含めます。

関連する問題