Skip to content

Commit

Permalink
资产管理翻页后删除按钮无反应BUG修复
Browse files Browse the repository at this point in the history
close #5
  • Loading branch information
guohongze committed Jun 16, 2017
1 parent 949f0b3 commit 9b8ffb6
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions templates/cmdb/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,22 @@
box.className="active";
}
</script>

<script>
$(document).ready(function(){
$('.asset_del').click(function(){
var row = $(this).closest('tr');
if (confirm("确定删除?")) {
$.get(
$(this).attr('value'),
{},
function (data) {
row.remove()
}
)
}
});
});
</script>

<div class="content-wrapper">
<!-- Content Header (Page header) -->
Expand All @@ -31,6 +46,7 @@
<!-- Main content -->
<section class="content">
<form action="" method="post" id="asset_form">
{% csrf_token %}
<div class="box">
<div class="box-header">
<div class="col-sm-2" style="padding-left: 0">
Expand Down Expand Up @@ -228,20 +244,6 @@
});
</script>
<script>
$(document).ready(function(){
$('.asset_del').click(function(){
var row = $(this).closest('tr');
if (confirm("确定删除?")) {
$.get(
$(this).attr('value'),
{},
function (data) {
row.remove()
}
)
}
});

$('#asset_del').click(function () {
var asset_id_all = getIDall();
if (asset_id_all == ''){
Expand All @@ -259,7 +261,6 @@
});
}
});
});
</script>

{% endblock %}

0 comments on commit 9b8ffb6

Please sign in to comment.