I have problems with select2 or autocomplete because the select contains many records and gives error 505 in server.
Is there any alternative to use select2 in a field in a conventional way, calling with ajax and limiting the number of records. It can be done with some event when I select field or grid.
$( “#selectClient” ).select2({
placeholder: “Select a client”,
minimumInputLength: 2,
ajax :{
url: ‘clients.php’,
dataType: “json”,
type : ‘post’,
delay: 250,
data: function (params) {
return {
name: params.term //
};
},
processResults: function (data) {
return {
results: data
};
},
cache: true
}
});
At least some idea.
Hello,
You can try this demo.
Demo: https://www.gridphp.com/demo/demos/integrations/dropdown-select2-ajax.php
Code: https://www.gridphp.com/demo/demos/integrations/dropdown-select2-ajax.phps
It uses select2 and load data based on ajax call and does preload load large dataset.
PS: Apologies for the delay.