Edit data from django-ajax-datatable

113 views
Skip to first unread message

Eugene TUYIZERE

unread,
Oct 17, 2021, 1:07:46 PM10/17/21
to django...@googlegroups.com
Dear Team,

I am using django-ajax-datatable and I have this:
image.png

The Edit button is added from server side as follow: 
def customize_row(self, row, obj):
row['edit'] = """
<a href="#" class="btn btn-success btn-edit"
onclick="var id=this.closest('tr').id.substr(4); alert('Editing Input number: ' + id); return false;">
Edit
</a>
"""

the table itself is rendered to html from:

<script language="javascript">

$(document).ready(function() {
AjaxDatatableViewUtils.initialize_table(
$('#datatable_membership'),
"{% url 'ajax_datatable_membership' %}",
{
// extra_options (example)
processing: true,
autoWidth: false,
full_row_select: true,
scrollX: false
}, {
// extra_data

},
);

});

</script>

when you click the edit button there is an alert showing the ID of the record.

Then, from the code above, what can I do such that when I click on the Edit button the new window of the clicked ID is showing out so that I can edit the record? 


Thank you for the help

regards, 
--
Eugene

Reply all
Reply to author
Forward
0 new messages