Use of JQueryeasyUI

Source: Internet
Author: User
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 );
 
 
Name Occupation

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

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.