I'm very new to EXTJS.I want to know the concepts of following.
Ext.BLANK_IMAGE_URL = 'folder_closed.gif';
Ext.QuickTips.init();
Ext.form.VTypes["nameVal"] = /^([A-Z]{1})[A-Za-z\-]+ ([A-Z]{1})[A-Za-z\-]+/;
Ext.form.VTypes["nameMask"] = /[A-Za-z\- ]/;
Ext.form.VTypes["nameText"] = 'In-valid Director Name.';
Ext.form.VType开发者_运维技巧s["name"] = function(v){
return Ext.form.VTypes["nameVal"].test(v);
and also what does the "renderTo:document.body"
do ....?
The first bit of code registers a so-called vtype
which is a validation-element that can be used to validate to textfield form elements simply by applying a vtype
-attribute. In your case the vtype
-name would be name
.
{
...
xtype: "textfield",
vtype: "name",
...
}
The renderTo
property does the following (from the ExtJS documentation):
Specify the id of the element, a DOM element or an existing Element that this component will be rendered into.
Although the learning curve is steep with ExtJS, you should read the API documentation - almost all questions can be answered from there (including both of your questions).
精彩评论