PDA

View Full Version : HTMLEditor maxLength



archmisha
6 Aug 2009, 11:43 PM
Hi,
I would like to set maximal length to the html editor as i do in textfield, so i wont get datbase error when inserting (or server validation error when sending the data).

I cant find how to do that, and even if i only check on 'synch' event the length of the htmleditor i can seem to activate the validation icon.

Anyone got any clue maybe?
thanks

steffenk
6 Aug 2009, 11:48 PM
use sync event, and if length greater than allowed, mark it as invalid.

archmisha
7 Aug 2009, 12:24 AM
Thats what i tried to do. But seems markInvalid:Ext.emptyFn in htmlEditor
Is it for a reason?

Condor
7 Aug 2009, 1:19 AM
Disabling validation marking was a bit drastic. qtip and title message targets wouldn't work, but side and under could work.

archmisha
7 Aug 2009, 2:24 AM
Working fix:


Ext.override(Ext.form.HtmlEditor,
{
markInvalid: function()
{
Ext.form.HtmlEditor.superclass.markInvalid.apply(this, arguments);
},

alignErrorIcon: function()
{
this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);
}
});

steffenk
7 Aug 2009, 3:41 AM
good :)

i think we need an Ext-override-repository ;)

Condor
7 Aug 2009, 3:57 AM
Somebody care to post a bugreport about the missing HtmlEditor markInvalid and clearInvalid implementation?

steffenk
7 Aug 2009, 4:03 AM
I'll do.

done: http://extjs.com/forum/showthread.php?t=76932