Показать сообщение отдельно
  #4 (permalink)  
Старый 16.09.2018, 22:50
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,068

Alex57B,
<!DOCTYPE html>

<html>
<head>
  <title>Untitled</title>
  <meta charset="utf-8">
  <style type="text/css">
  #testConfirm {
      display: none;
  }
  #testConfirm.active {
      display:  block;
  }
  </style>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

  <script>
$(function() {
    var html;
    html = '<div class="simple-dialog-content">';
    html += '<div class="simple-dialog-header"><h3 class="title">Подтвердите</h3></div>';
    html += '<div class="simple-dialog-body"><p class="message">Удалить</p></div>';
    html += '<div class="simple-dialog-footer clearfix"><button class="simple-dialog-button accept" data-action="submit">ОК</button><button class="simple-dialog-button cancel" data-action="submit">Нет</button></div>';
    html += '</div>';

    $('#testConfirm').html(html);
    var tr;
    $('#testConfirm').on('click', 'button[data-action="submit"]', function(e) {
         if ($(this).is(".accept")) {
            tr && tr.remove();
        }
        $('#testConfirm').removeClass('simple-dialog active');

    });
    $('tr i#delete-product').click(function(event) {
        tr = $(this).parents("tr");
        $('#testConfirm').addClass('simple-dialog active');
    });
});
  </script>
</head>

<body>
<table>
    <tr data-shopcode="TS62969">
        <td class="text-push">TS62969</td>
        <td>Прямой терморегулирующий вентиль 1/2" ВР (арт. FT 1640 12)</td>
        <td class="text-push product-qty" data-type="product_qty" id="edit-data">2</td>
        <td class="text-center">шт</td>
        <td class="text-push" nowrap=""><span class="product-price">883</span> руб.</td>
        <td class="text-push" nowrap=""><span class="ammount-products-price">1766</span> руб.</td>
        <td class="action edit"><i class="fa fa-pencil-square fa-2x" aria-hidden="true"></i></td>
        <td class="text-center"><i class="fa fa-trash-o  fa-2x" aria-hidden="true" id="delete-product">x</i></td>
    </tr>

</table>
<div id="testConfirm"></div>
</body>
</html>
Ответить с цитированием