EasyUI Forum

General Category => General Discussion => Topic started by: aswzen on December 26, 2016, 11:06:25 PM



Title: Red underline on datagrid text input or textbox (when grammar is error)
Post by: aswzen on December 26, 2016, 11:06:25 PM
I see there are red underline in grammar error text on easyui textbox or textarea (on datagrid too), like this
(http://i.imgur.com/4NmxvPx.jpg)

I try to mod the easyui.min.js and adding
Code:
spellcheck=\"false\"
like code below
Code:
init:function(_7bf,_7c0){
var _7c1=$("<input type=\"text\" spellcheck=\"false\" class=\"datagrid-editable-input\">").appendTo(_7bf);
if(_7c1[name]&&name!="text"){
return _7c1[name](_7c0);
}else{
return _7c1;
}
}

it works but do you want consider to add this as easyui builtin optional in the future?

Thank you in advance


Title: Re: Red underline on datagrid text input or textbox (when grammar is error)
Post by: stworthy on December 28, 2016, 04:31:51 AM
To disable all the 'spellcheck', just override the 'initValue' method.
Code:
<script type="text/javascript">
(function($){
var initValue = $.fn.textbox.methods.initValue;
$.extend($.fn.textbox.methods, {
initValue: function(jq, value){
return jq.each(function(){
initValue($(this), value);
$(this).textbox('textbox').attr('spellcheck', 'false');
});
}
})
})(jQuery);
</script>

You also can disable the 'spellcheck' on the <form>.
Code:
<form spellcheck="false">
...
</form>