lundi 7 novembre 2016

.I want to change button text on click and I do it with JQuery but i need to do it with ember bindings how can I do this. Here is my code

Component.js Here is my component.js i get here my button value and change it.

actions: {
 changeValue: function() {
 this.$().on('click', '.cellValue', function(event) {
 if ($(this).text() == '|') {
  $(this).text('-');
  $(this).val('-');
} else if ($(this).text() == '-') {
  $(this).text('|');
  $(this).val('|');
} else {

} });
 } },

Template.hbs Here is my template.js There is a tables inside td buttons which text i want to change

 <table>
 
 
 <tr class="as">
  
    <td><button id="button_id" class="cellValue"       value=""></button></td>
  
</tr>
 
  




Aucun commentaire:

Enregistrer un commentaire