PHP-EasyUIDataGrid data retrieval method

Source: Internet
Author: User
EasyUIDataGrid is a DataGrid written with Jquery. it can be seen that it is a front-end WebUI technology. to operate on this DataGrid, when passing parameters to the backend, the EasyUI DataGrid is a DataGrid written with Jquery. it can be seen that it is a front-end Web UI technology, generally, when you generate a DataGrid, it is common to use background PHP and other background languages to directly generate HTML syntax to display the DataGrid. when you want to operate on the DataGrid, when passing parameters to the backend, the entire web page is re-generated.

EasyUI DataGrid supports two methods. One is that, as mentioned above, the backend server generates HTML and displays it to the front end. The other is that AJAX is used to generate data, simply feed the data in JSON format to the front-end. after the front-end receives the data, use JQuery to refresh the screen of this part of the DataGrid when you analyze your data.

The second approach is introduced here. AJAX technology can be used to operate data layer-> control layer-> presentation layer-independently, in my previous multi-level architecture design preface, I will not put all HTML production in PHP like the old method, resulting in PHP developers themselves, it is also necessary to have a deep understanding of HTML and other front-end technologies before development.

In this way, another benefit is that the front-end UI can be changed, but the background program does not need to be modified significantly. Currently, JavaScript DataGrid in JSON format is supported in many different ways. you can also refer to the DataGrid provided by other companies to select the most suitable one.

Here, let's look at the code to better understand what I mean:

First, you need to design the html ui interface to define the columns to be displayed and the display names of the columns. EasyUI DataGrid also provides the column definitions for this part, using JavaScript for dynamic definition, I am used to using HTML for direct definition, which is not complicated. in the future, it is easier for the Web artist to directly operate on the division of labor.

This part focuses on URL settings.
DataGrid2.php

The code is as follows:








A small elastic easyUI datagrid



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.