I am working on an application which uses ExtJS4 for the front-end. Right now, I am using a border layout for the home page of my application. I will describe the components in my border layout here:
north: It has a header and a toolbar/menu below it.
west: It has a tree panel.
center: It has tab panels.
Now, my question is related to the header...the header consists of the application logo and application name on the left side and buttons/icons displaying the user name,log out,help,etc on the right side. Also, the menu below it, will display buttons based on the privileges that the current user has!
********* The requirement for the header in the home page of my application is exactly the same as the header of the Sencha homepage http://www.sencha.com/products/extjs/, wherein
Now,here are my questions:
If this is not the right approach to create the header for the home page, Can someone please guide me on any other better approach to this..
Thanks in advance
Maybe try starting with a plain old container with an hbox layout. It can have two items: the first (left) item can be the image and the second (right) can be another container (or even a toolbar) that manages the buttons/links/whatever.
The benefit of this is that you can control each section (right and left) independently in terms of content, widths, etc.
I'd encourage you to look at the source for the kitchen sink site. This is pretty much what they're doing...
Ext.define("KitchenSink.view.Header", {
extend: "Ext.Container",
title: "Ext JS Kitchen Sink",
height: 52,
layout: {
type: "hbox",
align: "middle"
},
initComponent: function() {
...
this.items = [
{xtype: "component",id: "app-header-logo"},
{xtype: "component",id: "app-header-title",html: this.title,flex: 1}
];
if (!Ext.getCmp("options-toolbar")) {
this.items.push({xtype: "themeSwitcher"})
}
this.callParent();
}
});