refresh matview stockprop happens in ajax controller
[sgn.git] / js / CXGN / BreedersToolbox / HTMLSelect.js
blob734ddd0ab7bd9e2768d1bce246b82cf85f4ba043
2 function get_select_box(type, div_id, options) {
4     //alert(JSON.stringify(options));
5     jQuery.ajax( {
6         url: '/ajax/html/select/'+type,
7         data: options ,
8     beforeSend: function(){
9         var html = '<div class="well well-sm"><center><img src="/img/wheel.gif" /></center></div>';
10         jQuery('#'+div_id).html(html);
11     },
12         success: function(response) {
13       jQuery('#'+div_id).empty();
14             jQuery('#'+div_id).html(response.select);
15         if (options.live_search) {
16             var select = jQuery("#"+options.id);
17             select.selectpicker('render');
18             select.data('selectpicker').$button.focus();
19             select.data('selectpicker').$button.attr("style","background-color:#fff");
20         }
21         },
22         error: function(response) {
23             alert("An error occurred");
24         }
25     });