开发者

Pass variable into nested jquery template

开发者 https://www.devze.com 2023-03-27 17:16 出处:网络
<script id=\"mainTemplate\" type=\"text/x-jquery-tmpl\"> {{each(i, wrapSpec) data}} <div id=\"pkgLineTabs_{{= wrapSpec.wrapSpecId}}\" style=\"font-size:12px\"
<script id="mainTemplate" type="text/x-jquery-tmpl">

{{each(i, wrapSpec) data}}

<div id="pkgLineTabs_{{= wrapSpec.wrapSpecId}}" style="font-size:12px" 
     class="reportTable display {{= wrapSpec.wrapSpec2.pkgLineId.hash}}" title="{{= wrapSpec.wrapSpec2.pkgLineId.hash}}" >  

    {{tmpl(wrapSpec.repo开发者_如何学JAVArt) "#dayTemplate"}} <!-- need to pass avgOunces variable !-->

</div>  

{{/each}}

   <script id="dayTemplate" type="text/x-jquery-tmpl">

<!-- need avgOunces variable down here !-->


    <br />
</script>

Ok say I have a template like this. In the nested template call I want to pass a variable that the first template has so it has access to that variable. How would I go about doing that? Thanks for the help.


Never mind. I got it.

{{tmpl(reportPerHour, { avgText : avgText }) "#hourTemplate"}}

In next template

{{= $item.avgText }} 

Not sure why I need the item variable though.

0

精彩评论

暂无评论...
验证码 换一张
取 消