Use Ext JS. Do not use pages for Component Reuse. Try not to perform page Jump.

Source: Internet
Author: User

Today, someone asked me how to solve the problem:

A Grid, select a record, click Edit, And the edit window is displayed with the edit form.) After editing, click Save to save the form, close the window, and refresh the Grid.


This is simple, but it is quite complicated because the developer's understanding of Ext JS is not in place.


The main complexities are as follows:

  • In order to edit the form reusable, the form is made into a page, and then the IFRAME in the Window opens the page.

  • Form submission is not submitted by Ajax, but by page Jump. As a result, everything is complicated.


This is not the case. On the final submission page, call the parent object to operate on the parent page, close the window, and refresh the Grid. However, this is too complicated.


The problem here is that the development of Ext JS is not in place, or the application of Ext JS is written according to the old development method. Therefore, simple things are complicated at once, this is also a common mistake made by many beginners.

To use Ext JS for development, remember the following points:

  • Data Interaction in Ext JS is basically based on Ajax and interacts with data in JSON or XML format. In this process, no page Jump is required, all data is processed in a standardized data format, such as error processing, successful storage, and so on. Data in JSON or XML format can be sent to the client, let the client handle it.

  • Use Ext JS, especially 4) compile your own extensions to Achieve Component Reuse, which is very convenient and does not need to make the reuse part into a page.

  • Using Ext JS 4 can easily implement single-page applications, that is, only one page is required. The data interaction between the client and the server follows the first point. Of course, if you are worried about performance, you will also implement multi-page applications in the IFRAME format. However, you must understand that this is also based on a single page, which means, the process of an IFRAME page is basically the process of a single page application. You do not need to control multiple pages as you are using Web development. It is very important to understand this. Otherwise, it would be better to use the conventional Web development method directly without Ext JS.

  • Ext JS also separates data from the UI on the client. Do not look for data in the UI.

  • Ext JS is used to organize the UI Based on components, rather than HTML code, even though HTML code is generated. Generally, you do not need to directly write HTML code to implement the application. If you really need to use HTML code, it is necessary to consider why it should be used, whether there are alternative solutions, and how to use it.

The above personal opinions may not be taken into consideration.


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.