Learn Extjs5 with me. (38--design of individual modules [6 get Module list data])

Source: Internet
Author: User

Learn Extjs5 with me. (38--design of individual modules [6 get Module list data])
In the previous section, we have done the pre-background program and now look at the process of getting the data. In the menu, select System Management-module grouping. As you can see, the data is displayed after the grid is rendered.

Take a look at the URL and data for Ajax to get data. URL information:
Remote address:[::1]:8888request url:http://localhost:8888/app/rest/module/fetchdata.do?_dc=1413113401477& Modulename=_modulegroup&page=1&start=0&limit=20request method:getstatus Code:200 OK
Query String parametersview sourceview URL encoded_dc:1413113401477modulename:_modulegrouppage:1start:0limit:20
Above is the URL inside the parameters sent to the background, including the module name, get the starting line, the number of records per page and other information.        These are just the basic information, later complicated to add sorting information, grouping information, filtering information, navigation list information. The following is the data returned by the server:
{"TotalCount": 8, "records": [{"Tf_modulegroupid": "Ten", "Tf_title": "Project Management"}, {"Tf_modulegroupid": "A", "Tf_title": "Close With Management "}, {" Tf_modulegroupid ":" $ "," Tf_title ":" Money Management "}, {" Tf_modulegroupid ":" + "," Tf_title ":" Encoding Settings "}, {" Tf_modulegroup Id ":" "Tf_title": "System Settings"}, {"Tf_modulegroupid": "94", "Tf_title": "File Compilation"}, {"Tf_modulegroupid": "The", "Tf_title" : "Attachment Management"}, {"Tf_modulegroupid", "Tf_title": "System Module"}]}

TotalCount represents the total, records is an array and returns the page data to be obtained.
SQL statement that gets data in the background: calculates the total number of records that meet the current criteria, and then gets the paging data
Hibernate:     Select        count (*)      from        _modulegroup _t9901hibernate:     Select        Top 8    _T9901.TF _modulegroupid as Tf_modulegroupid,        _t9901.tf_title as Tf_title,        _t9901.tf_description as Tf_description,        _t9901.tf_iconurl as Tf_iconurl,        _t9901.tf_remark as Tf_remark        from        _modulegroup _t9901     ORDER BY        Tf_modulegroupid



The function of the grid to get the data is complete. As you can see, all the modules are using a unified function to get the data, not a module is going to build a controller, a service, a DAO.        This processing mode is also my software to achieve as far as possible, all the functions can be configured, and then by the front desk in the background to explain the implementation to complete. For a separate module that is not associated with other modules, this interpretation of the implementation scheme is relatively straightforward.        But the module has the subordinate, the Submodule, the parent module, and the module hierarchy many times, finally joins the permission, this explanation execution processing will be very complex. The goal of the final level is to select several fields of the associated module to perform a comprehensive query based on the information of the module and the meanings of the fields. These features have been explained in detail in one of my other blogs, and now is the time to implement them in a step-by-step.

Learn Extjs5 with me. (38--design of individual modules [6 get Module list 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.