Problems in call size with select2

QuestionsProblems in call size with select2
Juan Pedro asked 2 years ago

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.

1 Answers
Abu Ghufran Staff answered 2 years ago

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.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

11 + 6 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?