ajax-chosen
ajax-chosen copied to clipboard
Improving documentation
Hi good day, I want contribute with this
I needed, search a item by a property ( in backend) and show the name of the item with this property
I.E:
- Search: C++
- response: [{name: "My name to show, ability: "java, C++" }] In the documentacion, i don't find it so... i want contribute with this
$('.chosen-ajax').ajaxChosen({
type: "GET",
url: "my_path",
dataType: 'json'
}, function(data){
var result = [];
for (var i = data.length - 1; i >= 0; i--) {
var value = data[i];
/* Only need add search_text with the property */
result.push({"value" : value.id, "search_text" : value.property ,text: value.name})
}
return result;
}
)
The important Thing is: search_text