-
2 Mar 2010 11:56 PM #1
TreeGrid displays column headers but not rows
TreeGrid displays column headers but not rows
My TreeGrid here is displaying column headers but not rows. It also displays a vertical scrollbar. I can't figure out what is wrong with it--my best guess is that the JSON is not formatted correctly. What do I need to do to get this working?
Last edited by timblack1; 3 Mar 2010 at 12:06 AM. Reason: Changed icon to question mark
-
3 Mar 2010 12:06 AM #2
IIRC, you need to configure it with a Store like a grid.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
3 Mar 2010 12:49 AM #3
-
3 Mar 2010 1:36 AM #4
How does that create a Store?
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
3 Mar 2010 3:51 AM #5
I had the same problem and it looks like you have to set the columns' width (you will also see your records if you resize the 1st column)
-
3 Mar 2010 6:04 AM #6
i didn't see store in the sample (http://www.extjs.com/deploy/dev/exam.../treegrid.html).
can you show another example?
-
3 Mar 2010 8:28 AM #7
Thank you for your help! I don't know how it creates a store, nor am I sure it does, though I think somehow simply setting the dataUrl config option in the Ext.ux.tree.TreeGrid in tree-grid.js creates the store, using the TreeLoader, because the (unmodified) example here displays rows even though it doesn't explicitly create a store, and my treegrid is an only slightly modified copy of that example. I tried explicitly creating a store as a config option in tree-grid.js, but haven't gotten that to work yet.
Last edited by timblack1; 3 Mar 2010 at 8:29 AM. Reason: Fixed typo
-
3 Mar 2010 8:32 AM #8
Mate, you don't need a store. The only reason you can't see your tree is because you didn't set the columns' width... Do it and it will display correctly. You can also see that it works fine if you try to resize the first column in your grid, like I did:
-
3 Mar 2010 8:52 AM #9
Excellent! Thank you, that worked. I took the column widths out in the hope the TreeGrid's columns would automatically resize to fit their contents--is it still possible to get them to do that?
I'm trying to understand the updateColumnWidths code in TreeGrid.js to see whether it requires hard-coded widths in the initial config, and that research is what kept me from replying to you more quickly.
-
3 Mar 2010 8:54 AM #10
I was trying to make the columns auto expand with no success, so let me know if you manage to do it. Also, if you hide the column it will only hide it from rows, but not from the header


Reply With Quote