EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: zhaowenyi713 on November 30, 2014, 07:24:20 PM



Title: How to hid textBox and combobox
Post by: zhaowenyi713 on November 30, 2014, 07:24:20 PM
How to hid textBox and combobox in IE11 .  $("#XX").hide(); $("#XX").css("display", "none"); does not work.


Title: Re: How to hid textBox and combobox
Post by: stworthy on December 01, 2014, 02:55:15 AM
You can extend the 'show' and 'hide' methods easily.
Code:
$.extend($.fn.textbox.methods, {
show: function(jq){
return jq.each(function(){
$(this).next().show();
})
},
hide: function(jq){
return jq.each(function(){
$(this).next().hide();
})
}
})

Usage example:
Code:
$('#t1').textbox('hide');  // hide the textbox
$('#c1').combobox('hide');  // hide the combobox


Title: Re: How to hid textBox and combobox
Post by: zhaowenyi713 on December 07, 2014, 07:53:56 PM
You can extend the 'show' and 'hide' methods easily.
Code:
$.extend($.fn.textbox.methods, {
show: function(jq){
return jq.each(function(){
$(this).next().show();
})
},
hide: function(jq){
return jq.each(function(){
$(this).next().hide();
})
}
})

Usage example:
Code:
$('#t1').textbox('hide');  // hide the textbox
$('#c1').combobox('hide');  // hide the combobox

Thank you!


Title: Re: How to hid textBox and combobox
Post by: jega on June 08, 2021, 02:38:45 PM
Hi. Trying this

$.extend($.fn.textbox.methods, {
   show: function(jq){
      return jq.each(function(){
         $(this).next().show();
      })
   },
   hide: function(jq){
      return jq.each(function(){
         $(this).next().hide();
      })
   }
})

It hide/show textbox, but not the label. How to do this also. And can it be built in a future update

Jesper


Title: Re: How to hid textBox and combobox
Post by: jega on December 13, 2021, 02:30:53 PM
Hi stworthy

Still no solution to also hide/show the label ???


Title: Re: How to hid textBox and combobox
Post by: stworthy on December 13, 2021, 07:49:07 PM
These methods will be included in next version. They can be defined as below:
Code:
$.extend($.fn.textbox.methods, {
   show: function(jq){
      return jq.each(function(){
         $(this).next().show();
         $($(this).textbox('label')).show();
      })
   },
   hide: function(jq){
      return jq.each(function(){
         $(this).next().hide();
         $($(this).textbox('label')).hide();
      })
   }
})