The volist tag in thinkphp is detailed in Ajax

Source: Internet
Author: User
Implementing Volist tags in a thinkphp complex page (including volist) shows the return of jquery query results. This article mainly and everyone introduces thinkphp in the volist tag in the Ajax operation of the particularity (recommended), need to refer to the friend, hope to help everyone.

Background

Implement volist tags in a thinkphp complex page (including volist) to display the return of jquery query results

Knowledge points

The purpose of using AJAX is to not refresh the entire page without refreshing the partial table data, but note that the volist tag in the thinkphp framework is running on the server side, so the data obtained using JS dynamically cannot use the thinkphp tag and cannot be $this Ajaxreturn ($data); The result is directly with $ ("#p_id"). The HTML (data) method is displayed.

Current solutions found (all defective)

1. Create a new page to display

Reopen a jump page and return the value using the $this->assign ("Volist_name", $data); Returned in the same way.

* * BUG: The equivalent of reloading the entire page and not meeting the need for a partial update form.

2. Do not display the label of the thinkphp frame

Do not use volist tags, the results of the Ajaxreturn returned analysis, according to their own JS template templates to display, you can implement the local form update

1,template template <script id= "events-template" type= "X-tmpl-mustache" > {{#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.