Learn Extjs5 with me. (25--module form custom design [3])

Source: Internet
Author: User

Learn Extjs5 with me. (25--module form custom design [3])The custom form is ready to run, change the configuration below, and put the fieldset in the form under tab. Modify the schema under Tf_formschemes under Data in Modulemodel.js to add a property.

Once you've set it up, you can see that the fieldset is placed in tab in the form, and the following shows the two tab interface.

Theoretically, if your form configuration information is set properly, you can get the form of any style you want. But in the actual application, we only need to complete the majority of the automatic generation is enough, the real program has a super-perverted complex form structure, you can build scripts. The above code and example just shows how to customize a form, to be able to really apply also have to do a lot of work, for beginners or the experience is not very rich programmer, this as an extension of the view of the example to see the line.
The above is an editing window, the data edited later to be saved back to the model, this save does not use the MVVM feature, I write directly in the Baseform.js button control.
This.buttons.push ({text: ' Saved ', itemId: ' Save ', glyph:0xf0c7,handler:function (button) {button.up (' form '). GetForm (). UpdateRecord ();}},{text: ' Close ', itemId: ' Close ', glyph:0xf148,handler:function (button) {button.up (' window '). Hide ();});

after a form has called the data from the model using the Loadrecord (model) function, the model can be returned with Getrecord (), which can be used directly after the data has been modified UpdateRecord () To update the model with the values in the form. This statement was executed in the saved handler:button.up (' form '). GetForm (). UpdateRecord (); for Beginners, button.up (' form '), which starts recursively from the first parent container of the button, until the form is found, is a very good way to find another control based on the control, creating a way for everyone to find the control, Do not use the GETCMP (ID) method of this direct lookup. There is also a down method corresponding to up, which is a function that looks up the child controls of this control. After adding this method to the example above, you can save the data.


        



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.