Open source Invoicing Psi-extjs knowledge points (2)

Source: Internet
Author: User

Look at the code first

Ext.define ("PSI.        Sale.wsmainform ", {extend:" Ext.panel.Panel ", border:0, Layout:" Border ", Initcomponent:function () {        var me = this; The following code is slightly

1, the main meaning of the above code is to define a new Class:PSI.Sale.WSMainForm, the parent class is: Ext.panel.Panel

2, today's new knowledge point is: initcomponent

If you want to add new components to the UI, writing code in InitComponent is a must. So in many of the Psi JS code, there is a large section of code in the InitComponent, which is standard.

Ext.apply

This method is commonly used in initcomponent ext.apply, for example:

Ext.apply (me, {            tbar: [{                      text:  "New Sales Return inbound order",                     iconCls:  "Psi-button-add",                     scope: me,                      handler: me.onAddSRBill                 },  "-", {                     text:  "Edit Sales return inbound order",                     iconCls:  "Psi-button-edit",                     scope:  me,                     handler: me.onEditSRBill                 }                 //  the following code slightly

In layman's words, the Ext.apply method is to add attributes to an object, such as:

var a = {name: ' PSI ', age:30}; Ext.applay (A, {age:40, Region: ' Dalian '});//A + = {name: ' PSI ', age:40, Region: ' Dalian '}

The principle of merging is that existing properties are overwritten with new values, and new attributes are added.


Open source Invoicing Psi-extjs knowledge points (2)

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.