如何通过Helper Meteorjs获得Parent Div

时间:2014-11-21 17:52:43

标签: meteor meteor-blaze

我试图通过我在meteorjs中设置的帮助来访问父div或任何div。

例如,我怎样才能获得一个" form-group"对于isRegion帮手?

<div class="form-group">
      <div class="col-md-4">
        <select  name="{{regionsPart.name}}" type="select" class="form-control fields regionsField">
          {{#each regions}}
            {{#if isRegion}}
            <option class="choiceRegion" value="{{region}}" selected>{{region}}</option>
            {{else}}
            <option class="choiceRegion" value="{{region}}">{{region}}</option>
            {{/if}}
          {{/each}}
        </select>
      </div>

Template.mytemplate.helpers({
   'isRegion' : function(){
     var parentData = Template.parentData(1)
     var regions = Session.get('regions')
     var region = this.region;
     console.log($(this) trying to get the parent div for further use )
  )}

Thank you very much.

0 个答案:

没有答案