Tab become not activated

Discuss about Group-Office development here

Moderator: Developers

Thomas
Posts: 57
Joined: Fri Jul 24, 2009 1:52 pm

Tab become not activated

Postby Thomas » Wed Feb 19, 2014 3:04 pm

Hi @ all,

i am about to build my own module which is not the first one. but now the following problem occurs:

If i active my module tab i can see the content. if i switch to an other modul (e.g. Notes) evth. is ok, but if i switch back to my modul the content is not visible. GO still leave the class

Code: Select all

x-hide-display
on my tab. if i switch off the style

Code: Select all

display: none
manually with firebug i can see the content again, but not the contents of other modules/tabs.

Anyone face the same problem or have a hint to debug this behavior?

Regards and thanks in advance
jamesarthur
Posts: 55
Joined: Fri Nov 08, 2013 9:15 am

Re: Tab become not activated

Postby jamesarthur » Wed Feb 19, 2014 9:24 pm

Is it possible to post the code for your MainPanel.js?
Thomas
Posts: 57
Joined: Fri Jul 24, 2009 1:52 pm

Re: Tab become not activated

Postby Thomas » Thu Feb 20, 2014 8:31 am

Thanks for Reply,

of course i can post this. Its taken from "presidents" and modified. i have already a workaround in it:

Code: Select all

Ext.select("*[id*=go-module-panel-ticket]").removeClass('x-hide-display');
Here is the MainPanel.js

Code: Select all

// Creates namespaces to be used for scoping variables and classes so that they are not global.
Ext.namespace('GO.ticket');

GO.ticket.MainPanel = function(config){
	
	if(!config)
	{
		config = {};
	}
	
	this.centerPanel = new GO.ticket.TicketsGrid({
		region:'center',
		id:'pm-center-panel',
		border:true
	});
	
	this.centerPanel.on("delayedrowselect",function(grid, rowIndex, r){
		this.eastPanel.load(r.data.id);		
	}, this);

	this.centerPanel.store.on('load', function(){
			this.eastPanel.reset();
	}, this);
	/*
	this.westPanel= new GO.grid.MultiSelectGrid({
		region:'west',
		id:'no-multiselect',
		title:GO.notes.lang.categories,
		loadMask:true,
		store: GO.notes.readableCategoriesStore,
		width: 230,
		split:true,
		allowNoSelection:true,
		collapsible:true,
		collapseMode:'mini',
		bbar: new GO.SmallPagingToolbar({
			items:[this.searchField = new GO.form.SearchField({
				store: GO.notes.readableCategoriesStore,
				width:120,
				emptyText: GO.lang.strSearch
			})],
			store:GO.notes.readableCategoriesStore,
			pageSize:GO.settings.config.nav_page_size
		}),
		relatedStore: this.centerPanel.store
	});
	*/
	this.westPanel = new GO.ticket.GroupsGrid({
		relatedStore: this.centerPanel.store,
		region:'west',
		id:'ticket-groups-panel',
		width: 250
	});
	
	this.eastPanel = new GO.ticket.TicketPanel({
		region:'east',
		id:'pm-east-panel',
		width:440,
		border:true
	});
	
	//Setup a toolbar for the grid panel
	config.tbar = new Ext.Toolbar({		
			cls:'go-head-tb',
			items: [
				{
					iconCls: 'btn-add',							
					text: 'Neues Ticket',
					cls: 'x-btn-text-icon',
					handler: function(){					
						this.centerPanel.showEditDialog('hallo');
					},
					scope: this
				},
				/*
				{
					iconCls: 'btn-delete',
					text: GO.lang['cmdDelete'],
					cls: 'x-btn-text-icon',
					handler: function(){
						this.centerPanel.deleteSelected();
					},
					scope: this
				}
				*/
			]
	});
	
	config.items=[
	this.westPanel,
	this.centerPanel,
	this.eastPanel
	];	
	
	config.layout='border';
	GO.ticket.MainPanel.superclass.constructor.call(this, config);	
};

Ext.extend(GO.ticket.MainPanel, Ext.Panel, {
	show : function() {
		Ext.select("*[id*=go-module-panel-ticket]").removeClass('x-hide-display');
		this.westPanel.store.load();
	}
});


/*
 * This will add the module to the main tabpanel filled with all the modules
 */
GO.moduleManager.addModule(
	'ticket', //Module alias
	GO.ticket.MainPanel, //The main panel for this module
	{
		title : 'Ticketsystem', //Module name in startmenu
		iconCls : 'go-module-icon-ticket' //The css class with icon for startmenu
	}
);

/*
 * Add linkHandeler for linking models from this module to other GroupOffice models
 */
GO.linkHandlers["GO_Presidents_Model_President"]=function(id){
	if(!GO.ticket.linkWindow){
		var presidentPanel = new GO.ticket.PresidentPanel();
		GO.ticket.linkWindow= new GO.LinkViewWindow({
			title: GO.ticket.lang.president,
			items: presidentPanel,
			presidentPanel: presidentPanel,
			closeAction:"hide"
		});
	}
	GO.ticket.linkWindow.presidentPanel.load(id);
	GO.ticket.linkWindow.show();
	return GO.ticket.linkWindow;
}

GO.linkPreviewPanels["GO_Presidents_Model_President"]=function(config){
	config = config || {};
	return new GO.ticket.PresidentPanel(config);
}
jamesarthur
Posts: 55
Joined: Fri Nov 08, 2013 9:15 am

Re: Tab become not activated

Postby jamesarthur » Thu Feb 20, 2014 9:30 am

Hint: if you use

Code: Select all

 it will hilight php for you
jamesarthur
Posts: 55
Joined: Fri Nov 08, 2013 9:15 am

Re: Tab become not activated

Postby jamesarthur » Thu Feb 20, 2014 9:31 am

There is a groupoffice module for tickets in the professional modules. Maybe there is a conflict there? Otherwise I'm not sure why it isn't working.
mschering
Site Admin
Site Admin
Posts: 8333
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Tab become not activated

Postby mschering » Thu Feb 20, 2014 12:25 pm

It's because of your "id" property.

id:'no-multiselect',


id must be unique and this id belongs to the notes module. Be careful with copy pasting ;)
Best regards,

Merijn Schering
Intermesh
Thomas
Posts: 57
Joined: Fri Jul 24, 2009 1:52 pm

Re: Tab become not activated

Postby Thomas » Thu Feb 20, 2014 12:47 pm

Hello Merijn,

first of all u are right... more carefully while copy'n'paste-programming, but this was not the solution, because this JS what u have seen with that ID was comented out. I use the "westPanel"-Block after this u have seen...

I have deleted this part and no change of behavior :(

Regards

Thomas
jamesarthur
Posts: 55
Joined: Fri Nov 08, 2013 9:15 am

Re: Tab become not activated

Postby jamesarthur » Fri Feb 28, 2014 9:52 am

Getting the initial setup working can be tricky - all names etc must be exactly correct for it to work.

I made a module generator here: https://github.com/derekdreery/goadmin. Maybe use this as a starting point rather than an empty module?
Thomas
Posts: 57
Joined: Fri Jul 24, 2009 1:52 pm

Re: Tab become not activated

Postby Thomas » Fri Feb 28, 2014 9:55 am

Hi James,

i will give it a try... Thanks for supporting me.

Regards

Thomas

Who is online

Users browsing this forum: No registered users and 1 guest