Open source Invoicing Psi-extjs knowledge points (3)

Source: Internet
Author: User

Ext.create and New

Since PSI was developed with ExtJS 4.2, this knowledge point is for this version.

To create an object in JS, it must only be new, so ext.create will eventually have to use new, just to build its internal data structure and attach a lot of code.

The important thing to say three times: Create objects with Ext.create, create objects with Ext.create, create objects with Ext.create.

In the ExtJS, you can forget new!


Ext.define ("PSI. Customer.customerfield ", {extend:" Ext.form.field.Trigger ", Alias:" Widget.psi_customerfield ",//the following code slightly

Here's a new point of knowledge: alias-alias.

Aliases can also be used to create objects, such as the use of the above objects as follows:

                         {                             id:  " Editcustomer ",                             xtype:  "Psi_customerfield",                              parentCmp: me,                              fieldLabel:  "Customer",               &nBsp;             allowblank: false,                              labelWidth: 60,                              labelAlign:  "Right",                              labelSeparator:  "",                             colspan: 2,                              width: 430,                              blanktext:  "No customer input",                             beforeLabelTextTpl:  Psi. const.required,                             listeners: {                                  specialkey: {                                      fn: me.oneditcustomerspecialkey,                                      scope:  me                                 }                              }                         }

Pay special attention to the value of xtype in the above code!

Summary: Alias defines a new xtype, and when you use xtype elsewhere, you can reference the same alias value to create a new object.

The value of alias is in the format: widget. ABCD, then the value of Xtype is ABCD.

In the example: alias: "Widget.psi_customerfield"---xtype: "Psi_customerfield"

Open source Invoicing Psi-extjs knowledge points (3)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.