$("#select-processEmpid").select2({
????placeholder:"輸入一個(gè)負(fù)責(zé)人",//文本框的提示信息
????minimumInputLength:1,???//至少輸入n個(gè)字符,才去加載數(shù)據(jù)
????ajax:?{
????????url:?"url",
????????dataType:?'json',
????????delay:?250,
????????data:?function?(params)?{
????????????return?{
????????????????keyName:?params.term,?//?search?term
????????????};
????????},
????????processResults:?function?(data)?{
????????????return?{
????????????????results:data.responseContext
????????????};
????????}
????},
????templateResult:?formatRepo,
????templateSelection:?formatRepoSelection,
});英文文檔看不懂啊T_T,怎么給select2插件設(shè)置選中值。
select2插件設(shè)置初始值的問題,求大腿T_T
貓的第九尾
2015-12-25 11:27:44