morlandi / django-ajax-datatable

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

Having "pk" in column_defs is mandatory to draw the row_details #67

Closed Mike3285 closed 2 years ago

Mike3285 commented 2 years ago

Using the plugin, I noticed how having the

    column_defs = [
         ...
        {'name': 'pk', 'visible': True/False, },
         ...
]

is mandatory to have the table render the details appearing when a row is clicked. I didn't know this and it's not anywhere in the docs, I think it should be at least stated somewhere just for clarity, could have saved me some hours on debugging why my table wasn't rendering its row_details properly.

Missing the pk causes the table to pass "None" to the request it makes, thus leading to an empty context in the render_row_details

morlandi commented 2 years ago

This package has been developed to solve my own needs, and is occasionally improved as new project's needs arises. I'm sharing it "as is" in case someone else can make good use of it. In no way it claims to be perfect. However, I'm willing to accept PR to improve it

Fixed with #62 Thank you

Mike3285 commented 2 years ago

Don't worry, I am opening many issues because I find your package to be great and very useful, and I am using it in my own projects. As you say, I am trying to help you improve it and help other people that use / will use it by making it more understandable and stable. This's the spirit in open source! Don't take my issues as critictism to your work, the work is great and it's 100% understandable that a single person may have missed something here and there. Feel free to refuse my PRs if they are not in the original vision you had for this! BTW I think it's really great and I am looking forward to help you more on this, it's an awesome boost to any django project involving data display and filtering!

morlandi commented 2 years ago

Merged. Thank you