Home >Web Front-end >JS Tutorial >How to reference parent data inside the JsRender loop (the code is attached, I will introduce it to you in detail)

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

亚连
亚连Original
2018-05-18 13:36:132223browse

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>

Must add ".data''

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

Specific The code is as follows

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!

Statement:
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