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

On Embedded table, column header displays "None" #43

Closed
RamezIssac opened this issue Apr 15, 2014 · 5 comments
Closed

On Embedded table, column header displays "None" #43

RamezIssac opened this issue Apr 15, 2014 · 5 comments

Comments

@RamezIssac
Copy link

When working on embedded table , .. the datatable column header shows "None" instead of the actual column name.

And it's visible on the demo:
http://django-datatable-view.appspot.com/embedded-table/

@RamezIssac
Copy link
Author

So i find out that this is because the model isn't explicitly specified .

While the datatable is constructed from the ajax_url and option (which contains the column names) , the column title have another opinion and expect it's assignment from the model field name apparently.
I'm trying to dig-in deeper to find where the assignment actually take place , but no success yet.

@tiliv
Copy link
Contributor

tiliv commented Apr 16, 2014

Thanks for your patience so far! I'm sorry you've had trouble with the model value. I'll be happy to dig in and help get to the bottom of this one. I've just returned from a PyCon trip and now today I'm moving apartments, but by tomorrow I should be situated and able to really have a look.

Is your code pretty much the same as the pattern shown on that demo? If so, I'll try to construct a sample on my end and figure out what I can.

@tiliv
Copy link
Contributor

tiliv commented Apr 16, 2014

Oh, I misread your first comment, thinking that the demo was working while yours wasn't. I should be able to figure that one out. Sorry for the trouble!

@tiliv
Copy link
Contributor

tiliv commented Apr 16, 2014

My hunch is that you can add a third optional arg to get_datatable_structure() for model=TheModel. The base DatatableView normally passes that information along when it's the one responsible for the table construction. But in a satellite view situation, I think we've forgotten to include that tidbit in the documentation.

Let me know if that helps solve the problem, and I'll get that documentation updated when I'm able.

@RamezIssac
Copy link
Author

Lucky you just returning from PyCon trip. :) Good luck with moving apartments & Thanks for that cool piece of code.
As my 2nd comment , i did add the parameter model to get_datatable_structure & the issue got fixed indeed.
I suggest the app can be little further enhanced to fallback to provided column names (specified in parameter option) when there is no model passed.

Best

@tiliv tiliv closed this as completed Jun 14, 2014
tiliv added a commit that referenced this issue Jun 14, 2014
Addresses concern raised in #43 about how to correctly show table
headers on a separate view embedding a table.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants