Home > Web Front-end > JS Tutorial > body text

How to reference parent data inside the JsRender loop (the code is attached, I will introduce it to you in detail)

亚连
Release: 2018-05-18 13:36:13
Original
2157 people have browsed it

The following is how I compiled for you how to reference parent data inside the JsRender loop. Interested students can take a look.

A data of class A has attributes id, activityName and attribute smsBatch (which is a column of data).

You need to use the parent’s id when looping the subset smsBatch

Method:

<span style="background-color:rgb(255,255,102);">{{:#parent.parent.data.id}}</span>
Copy after login

Must add ".data''

That is, #parent.parent.data.Parent attribute name

Specific The code is as follows

Copy after login

The above is what I compiled for everyone on how to reference parent data inside the JsRender loop. I hope it will be helpful to everyone in the future.

Related articles:

Standardize the use of window.onload code examples in js (including code)

I will explain to you in detail how to create div, span, and label in js through the code

How to establish a model data model in js (the code is provided, simple and easy to understand)

The above is the detailed content of How to reference parent data inside the JsRender loop (the code is attached, I will introduce it to you in detail). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template