morlandi / django-ajax-datatable

A Django app which provides the integration of a Django project with the jQuery Javascript library DataTables.net
MIT License
211 stars 64 forks source link

Disable row-details #39

Closed delegate-it closed 3 years ago

delegate-it commented 3 years ago

Hi

Thanks for the great tool.

I was wondering if there is a way to disable the row-details. my datatable contains edit button on each row. I am having a problem with my edit button if clicked, the row-details shows and then I am taken to the edit page. Is there a way to disable the row-details so it doesn't show when the edit button is clicked?

morlandi commented 3 years ago

Hello, row-details should be disabled by default, unless you explicitly specify full_row_select = true as extra option to initialize_table():

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

Could you check this ? Mario