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