私のプロジェクトにはjquery.textcomplete.js
を使用していますが、jquery.textcomplete.js
は正しい単語を選択できないため、わずか5リストしか生成していません。リストのサイズを5から10以上に増やす方法を教えてください。jquery.textcomplete.jsの結果リストを増やす方法
私の言葉にスペースがある場合、たとえば「Close End Account Details」などの問題が発生した場合は、テキスト領域に「閉じる」と書いた後にスペースを空けても問題はありません。これを取り除くために私を助けてください。
以下はコードです。
$(document).ready(function() {
try {
var obj = [];
@{
foreach (var item in Model.WholeList)
{
@:obj.push('@item.Text');
}
}
$('#mytext').textcomplete([
{
words: obj,
match: /\b(\w{1,})$/,
maxCount :10,
search: function (term, callback) {
callback($.map(this.words, function (word) {
return word.search(new RegExp(term, "i")) == 0 ? word : null;
}));
},
index: 1,
replace: function (word) {
return ' ' + word + ' ' + ' ';
}
}
]);
}
catch (Exception) {
}
});
あなたが作成したコードを提供できますか?そうすれば、より良い方法でお手伝いします。あなたは[どのように私は良い質問をするのですか?](http://stackoverflow.com/help/how-to-ask)を読むこともできます。 –