rvera / image-picker

Image Picker is a simple jQuery plugin that transforms a select element into a more user friendly graphical interface.
http://rvera.github.com/image-picker
Other
906 stars 216 forks source link

add new option #10

Closed liuliang closed 11 years ago

liuliang commented 11 years ago

how can i changed options

rvera commented 11 years ago

Sorry, what do you need?

liuliang commented 11 years ago
$.ajax({
  url: "images.json"
}).done(function(data) {
  $.each(data, function(key, value) {   
       $('#mySelect')
           .append($("<option></option>")
           .attr("value",key)
           .text(value)); 
  });
});
rvera commented 11 years ago

After you have modified the original select you can "resync" it like this:

$("select").data("picker").sync_picker_with_select()