What’s going on here? This has plagued me for a while and is super annoying.
Notice this one is NULL – because I clicked on a
tag
within the button, which doesnt have data to pass.WHY is this being called? Because the parent has an action?
'click .uiActionPropertyModal'(event){
const target = event.target;
alert(target.getAttribute('data-propertyId'));
Modal.show('reportPropertyModal', function () {
window.thePropertyId = target.getAttribute('data-propertyId');
//return Cases.findOne(target.getAttribute('data-id'));
});
}
{{#each
propertiesArray}}
<div class="panel-body" >
<div class="col-md-3">
<a href="/project/{{_id}}" class="btn btn-info btn-block uiActionPropertyModal" data-propertyId="{{_id}}" style="{{getPropertyStatusCss}}">
<h1>{{address1}}</h1>
<h2>{{address2}}</h2>
<h2>{{city}}</h2>
<h2>{{province}}</h2>
<h2>{{postal}}</h2>
</a>
</div>
<div class="col-md-3">
<p>Status: {{status}}</p>
<p>Created: <time class="text-muted timeago" datetime="{{timeAgoCreated}}">{{timeAgoCreated}}</time></p>
<p>Updated: <time class="text-muted timeago" datetime="{{timeAgoUpdated}}">{{timeAgoUpdated}}</time></p>
<p>Risk Rating: {{riskRating}}</p>
<p>Rating: {{riskRating}}</p>
<p>Comments: {{overallComments}}</p>
</div>
</div>
{{/each}}