dimanche 1 octobre 2017

Displaying data based on ID of element - EMBER

Hej, I have a problem with displaying data based on a id. Each element has its own ID built in the loop process. The main aim: click on the operation and display comment. Each operation has its own comment that's why I'm using ID's.

Console.log shows appropriate id only problem to display container with data

Any help would be appreciated !

template.hbs:

<div class=" operation" id="">    
    <div class="name-container">
        <span class="operation-name">
        <i class="fa "></i>
        <i class="chevron down icon chevronIcon"></i>
      </span>
    </div> 
    <div class="comment-container " id="comment-container" style="display:none;" >
      <div class="comment-text comment-task"  >
          <span class=""></span>   
      </div>
    </div>   
</div>

template.js:

$('.operation').click(function(){
  var show = $(this).attr('id');
  console.log(show);
  $('.comment-container'+ show).show();
});




Aucun commentaire:

Enregistrer un commentaire