JQueryeasyUI was recently used as a background project of a company and came into contact with the JQuery easyUI front-end framework. it was deeply attracted by her concise code and simple and effective ajax interaction.
Experience has the following three aspects:
1) ability to quickly create tables:
Backend programs, such as PHP, only need to give the front-end a json Array, easyUI can loop through the array itself, fill the table, convenient and fast. One-Step paging
// Table PHP backend code $ pageList ['rows '] = array ('name' => 'Jay Chou', 'Work' => 'Singles '), array ('name' => 'Ye Liangchen ', 'Work' => 'net Red'),); $ pageList ['total'] = 2; echo json_encode ($ pageList );
2) ajax interaction between tables and backend PHP and other server programs:
In the preceding front-end code, the table contains an attribute url that is the backend address of the ajax request.
In addition, some common ajax interaction code is as follows:
Script // 1. set parameters. ajax requests the backend program var param ={}; var name =$ ("# serach_name "). val (); param ['name'] = name; $ ('# mytable '). datagrid ('load', param); // table id // 2. empty table data $ ('# dlg_show_detail_table '). datagrid ('loaddata', {total: 0, rows: []}); script
3) the current page is displayed, and you can search for and list the page at the same time:
In web applications, a list is often required, and then you can click View Details. easyUI can easily click View details, and supports details re-searching and paging (also based on ajax)
Script // The Code of the pop-up window is basically the same as the code of the preceding table, you only need to specify the class. // class = "easyui-datagrid" // Click a function lookOver (val, row) {return 'View' in the list ';} // Display $ ("# dlg_show_list_detail") in the pop-up window "). dialog ('open'); // The id of the pop-up table, script