PDA

View Full Version : Adding a dataview to an inherited class



dshookowsky
23 Mar 2012, 7:04 AM
I'm sure that this has something to do with me not getting the Tao of Sencha. I've structured my app as a Main view with a container that has the application "chrome"(report selection/ navigation / help) docked to one side and then a container for reports. The report area is implemented as another view that has all of the report "chrome" (e.g. filtering, sorting, etc).

So far all of this is fine, but then I tried to create a class that inherits from report that adds a dataview (the actual report data). The code seems to run fine, but no data appears in the Report window. If I add a debugger command and step through, I can see it rendering the dataview in the Top window, but it's eliminated when the report window is rendered.

Is this the normal pattern of development in Sencha or am I going against the grain? Why isn't the dataView rendered in the report?

mitchellsimoens
23 Mar 2012, 11:49 AM
Does the dataview have a size? Inspect the DOM to find the dataview and see if there are rows and if the dataview has a height.

dshookowsky
23 Mar 2012, 12:00 PM
I spent some time very confused as to why sencha adds display: none on to elements with no specific height. I had been using the "fullscreen: true" config, but that didn't get me anywhere.

When I added "flex: 1" it started showing up in the parent. In order to have it work from the child class I had to set this.dataView (where the dataView member is defined in the parent class) and then call this.callParent(). The parent class then creates the header and footer and adds this.dataView.

I would really love to see a non-trivial example that shows the best practices for implementing a solution with a proper class layout. I think it would help in understanding the how and why of Sencha.