EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on July 28, 2020, 03:35:53 AM



Title: Adding textbox cls to Version 1.4.4
Post by: devnull on July 28, 2020, 03:35:53 AM
Hi;

It's impossible for me to upgrade EUI due to the huge amount of customisation that's been added.

Can you let me have the code to add a 'cls' attribute to textbox in version 1.4.4 which was later added in V1.5.1 ?

Thanks


Title: Re: Adding textbox cls to Version 1.4.4
Post by: jarry on July 29, 2020, 05:10:26 PM
Please refer to this code to override a component definition.
Code:
<script type="text/javascript">
(function($){
var plugin = $.fn.textbox;
$.fn.textbox = function(options, param){
if (typeof options == 'string'){
return plugin.call($(this), options, param)
}
return this.each(function(){
plugin.call($(this), options, param);
var opts = $(this).textbox('options');
$(this).next().addClass(opts.cls)
})
}
$.fn.textbox.defaults = plugin.defaults;
$.fn.textbox.methods = plugin.methods;
$.fn.textbox.parseOptions = plugin.parseOptions;
})(jQuery)
</script>