I am trying to use \"Chosen\" plugin by harvest (http://harvesthq.github.com/chosen/) and it works for the static set of options I am passing. However, what I want is that w
You don't need to much stress , keep it simple. You need to add your ajax response in select box html and then update chosen.
This will look like..
Code:
var baseURL='Your Url';
$.ajax({
type: "POST",
url: baseURL+"Your function", //enter path for ajax
data: "id="+id, //pass any details
success: function(response){ //get response in json_encode()formate
var json_data = JSON.parse(response);
var i=0; var append='';
if((json_data['catss_data'].length > 0)){
for(i=0;i < json_data['response_data'].length; i++){
append+="";
// make response formate in option
}
$('#(selectbox-id)').html(append); // enter select box id and append data in it
}
}
$("#(selectbox-id)").trigger("chosen:updated"); // enter select box id and update chosen
});