1.  jQuery Chosen 选择框下拉值重置;

1
2
3
4
//重置
$("#easySelBrands").val("默认值").trigger("chosen:updated");
 
        

  赋值为默认值后要用trigger("chosen:updated")更新,否则无效;

jQuery Chosen 使用
    


            
jQuery Chosen 使用

 

 

2. 多个select在一起的问题

在chosen.jquery.js中找到此方法:

jQuery Chosen 使用
    


            
jQuery Chosen 使用
1 Chosen.prototype.activate_field
2  = function()
3  {
4     this.container.addClass("chzn-container-active");
5     this.active_field
6  = true;      
7     this.search_field.val(this.search_field.val());
8     return this.search_field.focus();
9 };
jQuery Chosen 使用
    


            
jQuery Chosen 使用

将此方法改为:

jQuery Chosen 使用
    


            
jQuery Chosen 使用
1  Chosen.prototype.activate_field = function() {
2       this.container.addClass("chosen-container-active");
3       this.active_field = true;
4       this.search_field.val(this.search_field.val());
5       var zindex = 1010;
6       this.container.css('z-index', '1010')
7       $('.chosen-container').not(this.container).css('z-index', --zindex);
8       return this.search_field.focus();
9     };
jQuery Chosen 使用
    


            
jQuery Chosen 使用

 

 

参考链接

https://github.com/amazeui/chosen/blob/master/docs/options.md

http://blog.csdn.net/iamduoluo/article/details/11519909

 

1.  jQuery Chosen 选择框下拉值重置;

1
2
3
4
//重置
$("#easySelBrands").val("默认值").trigger("chosen:updated");
 
        

  赋值为默认值后要用trigger("chosen:updated")更新,否则无效;

jQuery Chosen 使用
    


            
jQuery Chosen 使用

 

 

2. 多个select在一起的问题

在chosen.jquery.js中找到此方法:

jQuery Chosen 使用
    


            
jQuery Chosen 使用
1 Chosen.prototype.activate_field
2  = function()
3  {
4     this.container.addClass("chzn-container-active");
5     this.active_field
6  = true;      
7     this.search_field.val(this.search_field.val());
8     return this.search_field.focus();
9 };
jQuery Chosen 使用
    


            
jQuery Chosen 使用

将此方法改为:

jQuery Chosen 使用
    


            
jQuery Chosen 使用
1  Chosen.prototype.activate_field = function() {
2       this.container.addClass("chosen-container-active");
3       this.active_field = true;
4       this.search_field.val(this.search_field.val());
5       var zindex = 1010;
6       this.container.css('z-index', '1010')
7       $('.chosen-container').not(this.container).css('z-index', --zindex);
8       return this.search_field.focus();
9     };
jQuery Chosen 使用
    


            
jQuery Chosen 使用

 

 

参考链接

https://github.com/amazeui/chosen/blob/master/docs/options.md

http://blog.csdn.net/iamduoluo/article/details/11519909

相关文章:

  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2021-07-29
  • 2021-09-19
  • 2021-07-02
  • 2021-11-22
相关资源
相似解决方案