私はクライアントのリストを取得するためにSelect2 4.0.3を使用しています。 私はhttps://select2.github.io/examples.htmlのコードを使用する場合:私はD'ONTクロームコンソールでネットワークに見たときselect2 ajaxが起動しない
`$ajax= $(".ClientSearchSc");
/* recherche select2 + ajax */
$ajax.select2({
ajax:{
url: url+"/ajax/Cmd/Clients.php",
dataType: 'json',
delay: 0,
data: function (params) {
console.log(params.term);
return {
q: params.term, // search term
page: params.page
};
}
,
processResults: function (data,params) {
// parse the results into the format expected by Select2
// since we are using custom formatting functions we do not need to
// alter the remote JSON data, except to indicate that infinite
// scrolling can be used
params.page = params.page || 1;
return {
results: data,
pagination: {
more: (params.page * 30) < data.total_count
}
};
},
cache: true
},
minimumInputLength: 1
,
escapeMarkup: function (markup) { return markup; }, // let our custom formatter work
templateResult: clientiFormatResult,
templateSelection: clientiFormatSelection
});`
がClient.phpを見つけます!そして常にreaserchの8日後にSELECT2
いずれかが私を喜ばせることができますか? – Funpro