The particularity of the volist tag in thinkphp in ajax operations

jacklove
Release: 2023-04-02 07:50:01
Original
2288 people have browsed it

Implement the volist tag to display the return of Jquery query results in a complex ThinkPHP page (including volist). This article introduces to you the particularity of the volist tag in thinkphp in ajax operations (recommended). Friends who need it can refer to it

Background

In a Implement the volist tag in ThinkPHP's 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 Refresh some table data, but note that the volist tag in the ThinkPHP framework runs on the server side, so data dynamically obtained using js cannot use thinkPHP tags, and $this->ajaxReturn($data) cannot be used ; The result of is displayed directly using the method $("#p_id").HTML(data) .

Solutions found so far (all have flaws)

1. Create a new page for display

Reopen a jump page and you will be returned The value is returned in the form of $this->assign("volist_name", $data);.

**Defect: It is equivalent to reloading the entire page, and does not meet the requirement of partially updating the form.

2. Display without thinkPHP framework tags

Do not use volist tags, analyze the results returned by ajaxReturn, and display them according to your own js template, which can realize partial form updates

1,template

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!