21 Sep 2007 1:27 AM #1
[semi solved] Best practice - Loading different content in div
I'm really enjoying using Ext for the first time.
I am using Ext for a small cms. I am using the layout component(eg. west, north, east..etc)
I have a vertical navigation placed here. The navigation will have three items (home, list, create).
Here is where I need your suggestions. This area will be the container for the three pages that represent the three navigation items. So clicking home would display "home" page, clicking list would display "list" page that has a grid...You get the idea!
Now, what is the best tried&tested method for displaying the content within the Center panel for each click on the navigation?
Do I put three different div's inside the Center div, load content within all, then hide/show the divs depending on the current page?
Do I load a html/php page inside the div for every nav item click?
How would you do it?
Here is what I have so far:
21 Sep 2007 11:59 AM #2
21 Sep 2007 12:45 PM #3
It really depends what you want to do. I prefer the AJAH approach but you could just as well use an iFrame.
21 Sep 2007 4:30 PM #4
Thanks for the reply dotnetCarpenter.
Ext is new to me. I'm loving it so far and want to use it more. My daily job is flash actionscripting and php work. I really want to get into the whole web 2.0 application developemnt and by saying that, I mean ajax based applications. When I first saw the demos here, I had to try it out.
As you can see from the url I gave, the app im building is going well so far, i think
Now I've got to the stage where I need to build the container area for the pages in the middle, or as we all know to be the center div from the Layout module.
I want to avoid using the IFrame approach. You mention AJAH. How is that implemented?
21 Sep 2007 6:21 PM #5
- Join Date
- Apr 2007
- Sydney, Australia
- Vote Rating
When you load a content panel, you can give it a URL. This url should only return a dom fragment, which will be inserted into the content panel as an HTML block.
Check out the feed viewer example.
23 Sep 2007 7:58 AM #6
what do you mean by saying :
This url should only return a dom fragment
And how do I give it a url?
23 Sep 2007 8:26 AM #7
- Join Date
- Mar 2007
- Notts/Redwood City
- Vote Rating
What evant means is that what is sent back from the server in response to an Ajax request (It will have the HTTP header "X-Requested-With:XMLHttpRequest") should not be a full, valid HTML document.
There is no need for <html><head><body> etc. No need to do Ext.onReady in embedded scripts. Really, it should use your singleton application controller to request the services it needs.
23 Sep 2007 1:18 PM #8