Select2 fails to show 16th option


#1

I am failing to find a problem in my code. Even the simple tests leave me puzzled.

I have an xml file of db with this layout:

                    <table name="x">
			<id>1</id>
			<headline>laters img</headline>
			<content>laters text</content>
                       </table>

Using Xpath and Ajax I am exporting data from XML file to select2. It has to show headlines and it was showing fine when there were 15 headlines but it is not enough.

So if I add another table or another id, headline, content elements in existing table in that XML file, then Select2 fails to show the result. It says the results could not be loaded. Maybe there is a limiter left somewhere when I copied from web, not sure.

Code to initiate Select2:

$(document).ready(function(){

$("#selEmployee").select2({
/dropdownParent: $(’#myModal’),/
ajax: {
url: “search/ajax/ajaxfile.php”,
type: “post”,
dataType: ‘json’,
delay: 150,
data: function (params) {
return {
searchTerm: params.term // search term
};
},
processResults: function (response) {
return {
results: response
};
},
cache: true
},

});

});

I am still a newbie, so I would appreciate the help!


#2

If you console.log() the response passed to the processResults() callback, what does the logged data look like?

Also, can you post the contents of ajaxfile.php?