There is no way to set the size or maxLength attribute of a text input.
maxLength is also handled in code, rather than let the browser handle it.
This is a workaround to use the assigned maxLength value and adding a new config option 'size' Google Hacks:: File Format: PDF/Adobe Acrobatwant to do a search that the current Google interface does not support. .. of how to handle that keyword. Will the engine search for both keywords or for .. (Google's translation tools work very well for single-word translations like this. <input type="text" name="q" size=31 maxlength=255 value=""> http://www.grennan.com/index.php?option=com_docman&task=doc_download&gid=63HOME | Mark Ramskill - Feeds I Read:: But as BGR notes, the talk of Blu-ray does line itself up well with an true"input type="text" class="textfield" value="Your email address" Once you've got a handle on things, you can export the data via email in either HTML or CSV. are a form of online marketing that we don't discuss very often. http://www.ramskill.net/HOME |
// Textfield ignores size attribute of text..
Ext.form.TextField.prototype.size = 20;
Ext.form.TextField.prototype.initValue = function()
{
if(this.value !== undefined){
this.setValue(this.value); The Definitive Guide to Django: Web Development Done Right:: File Format: PDF/Adobe Acrobatall the engines listed here will work equally well with Django. Django does not care if a database table contains columns that are not defined in the model. This three-server setup should handle a very large amount of CharField(maxlength=50) response = models.TextField() http://www.puyb.net/download/djangobook/res.pdfHOME | Insert copyright and license here 1994 ! Netscape.ad --- app :: The directory and file listings are always maintained ! as equal size. Translations in the textfield portion of the mailing list view ! . Translations that apply only to javascript form element text fields; ! .. When Netscape is invoked with the -remote argument, it does not open ! window, http://turtle.ee.ncku.edu.tw/~tung/collect/config/Xresource/netscape/NetscapeHOME |
}else if(this.el.dom.value.length > 0){
this.setValue(this.el.dom.value);
}
this.el.dom.size = this.size;
if (!isNaN(this.maxLength) && (this.maxLength *1) > 0 && (this.maxLength != Number.MAX_VALUE)) {
this.el.dom.maxLength = this.maxLength *1;
}
};
Why not add a Truncate option to TextFields and default this to false. If truncate is true, then you limit the TextField length with a hard stop at the maxlength rather than an error message.
that should be
autoCreate : {tag: 'input', type: 'text', maxlength: '17', autocomplete: 'off'}
instead
2. you can use width config attribute to set TextField size
When I use
width: 500,
to size my input (xtype: textfield, inputType: file)
Ext will do
Set a style with width: 500,
but how do I can change the size="20"?
I tried:
autoWidth: true,
width: xxx,
autoCreate true or autoCreate: {tag: "input", type: "file", size: "MYSIZE", autocomplete: "off"} this works, but some CSS style is missing then, doesnt look like extjs textfields.
Is there any other way? Or is it meant to be that way?
Running: Ext Js 2.0 final
I think ExtJs should not change the usual things. The most people are accustomed to use size and maxLength. So, i think it shoud work the way we are accustomed. Shoud exists a size attribute on ExtJs textfield and the maxLength shoud lock typing. By creating a maxLengthLockTyping (true or false) attribute, people that agree with you would be satisfied.
1. maxLength is already handled the right way (the way it handled by browser is not very good, because you can't, for example, paste long text line to TextField and then cut out some not needed characters, browset will cut you long line for maxLength chars)
2. you can use width config attribute to set TextField size
Unfortunately, the default behavior when overtyping, is to show (after a delay), that the field is invalid, using
Ext.form.Field.prototype.msgTarget = 'side';
makes this very confusing for the end user. (as their is no error "message" visable in that case - just a red warning.)
While it is beneficial in some cases to allow overtyping, Having as a default is counter-intuitive for most users...
if would be far easier to have it as configurable at least.. - something like...
if (this.useBrowserMaxLength) && !isNaN(this.maxLength) && (this.maxLength *1) > 0 && (this.maxLength != Number.MAX_VALUE)) {
this.el.dom.maxLength = this.maxLength *1;
}
when's a bug not a bug - when it's a feature ;) - not always a clear line I guess.
I agree with Arikon. Since Ext forms provide instant feedback to the user, it improves usability to allow pasting and editing or overtyping and back tracking.
You can always use autoCreate to add any attributes you want to a field.
PS: If you don't agree with how something works, that doesn't mean it's a bug. You are welcome to post in the forums to openly discuss something you think should be different.
@Iveco, please start a new thread in 2.0 bugs for this issue, with a link back to this thread if necessary
p.s. this is the 1.x bugs forum, in case you didn't notice ;)
Nortel Unveils Vision, Strategy for Israeli High-Performance Net
Busy Friday Leads to Strong Close for Net Stocks
|