Results 1 to 3 of 3

Thread: FormPanel background color in a TabPanel?

  1. #1
    Ext JS Premium Member
    Join Date
    Oct 2007
    Vote Rating

    Question FormPanel background color in a TabPanel?

    I'm creating a FormPanel as a tab.

    What is the best way to have the FormPanel use the dialog background color (cyan) rather that the default TabPanel background color (white)? I like the contrast better on the dialogs.

    Obviously, I know I could use bodyStyle and set the background-color attribute, but I was hoping there is a more elegant, theme-friendly way to do this.

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    The Netherlands
    Vote Rating



  3. #3
    Ext JS Premium Member
    Join Date
    Oct 2007
    Vote Rating


    Condor, that would help if I wanted to change the form's background color to "#DFE8F6" explicitly with a stylesheet.

    But what I'd rather do is just have the TabPanel take on the normal background color for a plain FormPanel (#DFE8F6 using the defaul Ext JS theme) rather than the usual white. Preferably without stylesheet hacks so I can preserve the ability to easily use themes.

    Here's a sample slice of my code:

    // Meanwhile, inside the Viewport...
    region:			"center",
    xtype:			"tabpanel",
    id:				"maintabs",
    activeTab:		0,
    tabPosition:	"top",
    deferredRender:	false,
    defaults:		{ closable: false, autoScroll: true, border: false },
    items:			[
    	ProjectForm = new Ext.FormPanel({
    		id:				"panelProjectForm",
    		formId:			"ProjectForm",
    		title:			localize_tab_projectform,
    		url:			"loglist-ajax.aspx",
    		bodyStyle:		"padding: 10px",
    		defaultType:	"textfield",
    		items: [
    			{ xtype: "hidden", name: "guid", value: projectguid },
    			{ xtype: "hidden", name: "Command", value: "Save" },
    			{ fieldLabel: localize_project_formlabel_title,			value: localize_project_formvalue_title,		name: "title",			allowBlank:	false,	anchor:	"95%" },
    			{ fieldLabel: localize_project_formlabel_description,	value: localize_project_formvalue_description,	name: "description",	allowBlank:	true,	anchor:	"95%", xtype: "htmleditor" }
    	// ... More tabs defined here

Similar Threads

  1. FormPanel frame false background color
    By woozy in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 2 Jan 2010, 7:52 AM
  2. changing the background color of formpanel
    By harsha_velicheti in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 2 Oct 2009, 7:12 AM
  3. Setting a background color to a TabPanel
    By dana.lees in forum Ext 3.x: Help & Discussion
    Replies: 10
    Last Post: 30 Sep 2009, 7:36 AM
  4. How to change background color with field in formpanel
    By in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 1 Jan 2009, 10:55 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts