Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hidden_columns aren't rendered #23

Closed
foobar76 opened this issue Dec 6, 2013 · 2 comments
Closed

hidden_columns aren't rendered #23

foobar76 opened this issue Dec 6, 2013 · 2 comments
Labels

Comments

@foobar76
Copy link

foobar76 commented Dec 6, 2013

Here is my (shortend) dict:

datatable_options = {
        'columns': [
            ('action', None, 'get_pay_link'),
        ],
        'unsortable_columns': [
            'text',
        ],
        'hidden_columns': [
            'get_test', #function
            'modelfield', 
        ],
}

hidden_columns will not render in my templates (I expected hidden td fields). No changes in default_structure.html. Tested with 0.5.4

@tiliv
Copy link
Contributor

tiliv commented Dec 6, 2013

I believe this is the way datatables.js functions—the columns indeed should appear in the raw source, but the datatables Javascript actually reads the structure and removes those columns itself. They should still be available in its own API.

For example, some people use hidden columns to keep data only on the table for use with the "tabletools" plugin that exports the table to CSV, PDF, etc. Those hidden columns appear on the exports, but not on the traditional UI.

Can you verify that the raw "View Source" shows your columns with a data-visible="false" HTML attribute?

@foobar76
Copy link
Author

Yes you are right: http://datatables.net/release-datatables/extras/ColVis/exclude_columns.html the columns are not rendered in HTML. I did not figure out how I get the data of the "hidden" columns (maybe just via [aaData]) and it is currently out of my scope, but I will reply as soon as it gets back to my focus. Tnx

@rh0dium rh0dium closed this as completed Dec 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants