View Full Version : beginner question

13 Aug 2009, 11:36 AM
This is kind of a best practice question. I have it working, but wonder if there is a better way.

I am in the process of building an application using the border layout. The west region has an accordion with a few panels in it. I am loading those panels with a url back to the server. The server is returning a snippet of HTML and ext updates the panel with it.

That is working, but I am putting the CSS in that snippet to get it to look right. I know that when it replacing the html it isn't applying the style from an already downloaded CSS file, so I can use those classes.

I am also doing this same kind of thing for the center region.

Should I be doing something by creating an instance of the panel and using xtemplate for the formatting? Then just remove that panel when I don't need it, but leave it in memory. Then when I need it again show that panel and pass it new data for the template?

Thanks for the help.

13 Aug 2009, 12:08 PM
It's been my experience that if your CSS styling is not showing up on your autoloaded content, it means you're not being specific enough in your CSS rules. Bear in mind that ExtJS requires quite a bit of CSS to get its basic look and feel, and you have to be rather precise to override it.

If you provide more specifics, it might help. Here is another thread to get you started:

13 Aug 2009, 12:13 PM
Loading HTML is just done with innerHTML.

That does not process CSS.

Just set up your house stylesheet with the CSS rules that you will be using.