title: I want to add rows and locking again
body: <p>At first doing the normal error-free locking.I want to add rows pressure locking again.
  Where might errors ?
  I would be happy if you look at the example.
  add row > not works <a href="http://jsfiddle.net/ahmetsadri/SDctG/" rel="nofollow">demo</a></p>
  
  <p>HTML</p>
  
  <pre><code>&lt;table class="color"  cellpadding="2" cellspacing="2" id="myTable"&gt;
  &lt;tr&gt;
       &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td&gt;Lock/Unlock&lt;/td&gt;
      &lt;td&gt;Lock/Unlock&lt;/td&gt;
      &lt;td&gt;Lock/Unlock&lt;/td&gt;
  &lt;/tr&gt;
  
  
  &lt;tr class="row"&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;
          &lt;select name="select" id="selecta"&gt;
              &lt;option value="0"&gt;&lt;/option&gt;
              &lt;option value="1" selected&gt;Lock&lt;/option&gt;
              &lt;option value="2"&gt;Unlock&lt;/option&gt;
          &lt;/select&gt;
      &lt;/td&gt;
  
      &lt;td&gt;
          &lt;input name="textfield" type="text" class="textfield" value="1" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input name="textfield" type="text" class="textfield" value="1" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input name="textfield" type="text" class="textfield" value="1" /&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr class="row"&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;
          &lt;select name="select" id="selecta"&gt;
              &lt;option value="0"&gt;&lt;/option&gt;
              &lt;option value="1" selected&gt;Lock&lt;/option&gt;
              &lt;option value="2"&gt;Unlock&lt;/option&gt;
          &lt;/select&gt;
      &lt;/td&gt;
  
      &lt;td&gt;
          &lt;input name="textfield" type="text" class="textfield" value="1" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input name="textfield" type="text" class="textfield" value="1" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input name="textfield" type="text" class="textfield" value="1" /&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  
     &lt;tfoot&gt;
          &lt;tr&gt;
              &lt;td colspan="5" style="text-align: left;"&gt;
                  &lt;input type="button" id="addrow" value="Add Rows" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
  
      &lt;/tfoot&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>$(document).ready(function () {
      $('.row').each(function () {
          var $dropdown = $(this).find('#selecta'),
              $textfield = $(this).find('.textfield');
          $dropdown.change(function () {
              if ($dropdown.val() != '1') {
                  $textfield.removeAttr('disabled');
              } else {
                  $textfield.attr('disabled', 'disabled').val('');
              }
          }).trigger('change'); // added trigger to calculate initial state
      });
  });
  
  $(document).ready(function () {
              var counter = 0;
  
              $("#addrow").on("click", function () {
  
                  counter = $('#myTable tr').length - 2;
  
                  var newRow = $('&lt;tr class="row"&gt;');
                  var cols = "";
  
                  cols += '  &lt;td&gt;1&lt;/td&gt;&lt;td&gt;&lt;select name="select" id="selecta"&gt;&lt;option value="0"&gt;&lt;/option&gt;&lt;option value="1" selected&gt;Lock&lt;/option&gt;&lt;option value="2"&gt;Unlock&lt;/option&gt;&lt;/select&gt; &lt;/td&gt;&lt;td&gt;&lt;input name="textfield" type="text" class="textfield" value="1" /&gt;&lt;/td&gt;&lt;td&gt;&lt;input name="textfield" type="text" class="textfield" value="1" /&gt;&lt;/td&gt;&lt;td&gt; &lt;input name="textfield" type="text" class="textfield" value="1" /&gt;&lt;/td&gt;';
  
                  cols += '&lt;td&gt;&lt;input type="button"  value="x" &gt;&lt;/td&gt;';
                  newRow.append(cols);
                  if (counter == 4) $('#addrow').attr('disabled', true).prop('value', "You've reached the limit");
                  $("table.color").append(newRow);
                  counter++;
              });
  
      $("table.color").on("click", ".buttons", function (event) {
          $(this).closest("tr").remove();
          calculateGrandTotal();
  
          counter -= 1
          $('#addrow').attr('disabled', false).prop('value', "Add Rows");
      });
  
  
  });
  </code></pre>
  
  <p>I want to add rows pressure locking again.</p>