Response title
This is preview!
$("#jobSkills").select2({
ajax: {
url: ajax_object.ajax_url + "?action=autoSkills",
dataType: 'json',
delay: 250,
type: 'POST',
data: function (params) {
return {
skill: params.term,
page: params.page
};
},
processResults: function (data, params) {
params.page = params.page || 1;
console.log(data);
return {
results: data.items,
pagination: {
more: (params.page * 30) < data.total_count
}
};
},
cache: true
},
minimumInputLength: 1,
tags: "true",
tokenSeparators: [',', '#'],
maximumSelectionLength: 3,
placeholder: "Ex. Java, MS Office, SEO"
//data:
});
var data = [{ id: 0, text: 'enhancement' }, { id: 1, text: 'bug' }, { id: 2, text: 'duplicate' }, { id: 3, text: 'invalid' }, { id: 4, text: 'wontfix' }];
© 2013 jQuery Foundation
Sponsored by and others.