Fakultas Ilmu Komputer UI

Commit b419033c authored by Muhammad Ilham Peruzzi's avatar Muhammad Ilham Peruzzi
Browse files

add delete button add script to link button to business logic

parent b4bca2c0
......@@ -76,6 +76,15 @@
</div>
</div>
<!-- Jquery n Bootstrap Script -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="application/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="application/javascript">
$(".to-do-list-delete-button").on("click", function(e) {
var uid = $(this).data('id');
location.href="delete_todo/" + uid;
});
</script>
</body>
<footer>Made with Love by &copy; Muhammad Ilham Peruzzi</footer>
</html>
......
......@@ -14,7 +14,8 @@
{% endif %}
<table id="id_list_table" class="table">
{% for item in list.item_set.all %}
<tr><td>{{ forloop.counter }}: {{ item.text }}</td></tr>
<tr><td>{{ forloop.counter }}: {{ item.text }}</td>
</tr> <button class="to-do-list-delete-button" data-id="{{item.id}}">Delete</button>
{% endfor %}
</table>
{% endblock %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment