- changed status to resolved
Include a href in results
Hello,
Firstly, thanks for the efforts of making this program and making it available, it's a great solution for Django! Secondly, I am not sure if this is the correct place for an inquiry: I could not find a mailing list or support forum...
I have a datatable which has clickable links in the table results. Before using datatables with server side processing, my template would create the link from the object's slug. How would I go about doing the same when using a table created by django-datatables-view?
Best, Marcks
Comments (3)
-
reporter -
repo owner It can be done with renderer column or by defining own prepare_results function. Have a look at Readme and example in Another example of views.py customisation section
-
reporter Thanks, I redid it with a prepare_results function. It's much cleaner now and easier to use. Thanks for your help!
- Log in to comment
I made a custom render_column definition in the class defined in my views.py. It is the below code. Note that my model name and url name are the same, except that the model was typed with a upper case first letter. Adjust the url reversal for your own typical case.