Generating a new module issues.

Discuss about Group-Office development here

Moderator: Developers

carlos.camacho
Posts: 62
Joined: Thu Mar 05, 2009 8:02 pm

Generating a new module issues.

Postby carlos.camacho » Sun Apr 12, 2009 10:57 pm

Hi, im playing arroung with the testmodule example and there is a part in the PresidentsGrid.js where you put this code

/* config.paging is an added functionality by Group-Office
* which makes it very easy to add a PagingToolbar.
*/
config.paging=true,

There is a way to set the default 30 items per page to 10 or 15?, better there is an API where i can search for this attribute?
--

Also, there is a way to add html code generated by another php file? (I have a php page where i see statistics of my servers, and another info of my students, all in a little div) to an empty module? in the example in the part where you print Hello world??

config.html='Hello World';

I try adding html code and works perfectly, but is interesting if we can reuse php code adding a rute or import this file, so in the blanc page show the div content of my old php page?, I dont want to re write completely the code for GO just importing it?
mschering
Site Admin
Site Admin
Posts: 8284
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Generating a new module issues.

Postby mschering » Tue Apr 14, 2009 6:56 am

You can set the number of items in a list at the settings of a user.

--

You can do a panel.load('http://mypage/index.php'); to load the html in to the panel. Please read the ExtJS docs. You could also put an iframe into the module. You can have a look at the phpbb3 module to see how that is done.
Best regards,

Merijn Schering
Intermesh
carlos.camacho
Posts: 62
Joined: Thu Mar 05, 2009 8:02 pm

Re: Generating a new module issues.

Postby carlos.camacho » Tue Apr 14, 2009 12:56 pm

Yes, i can set the variable "Maximum number of rows in lists", but this will afect all list in my GO installation, for example i will like to have in my module just 3 items by list (I have 3 grids in my testing module) but if i do this the mail module will have 3 mails by page and this is not a good idea, in the paging functionality of group office there is a way to set this but locally for each grid?.
carlos.camacho
Posts: 62
Joined: Thu Mar 05, 2009 8:02 pm

Re: Generating a new module issues.

Postby carlos.camacho » Tue Apr 14, 2009 2:45 pm

I kind resolved the problem, just added this to my NewGrid.js

config.bbar = new Ext.PagingToolbar({
cls: 'go-paging-tb',
store: config.store,
pageSize: 5,
displayInfo: true,
displayMsg: GO.lang.displayingItemsShort,
emptyMsg: GO.lang['strNoItems']
});

Set the variable pageSize to whatever you want,
comment the line that says config.paging=true;

and in file json.php the variable $limit is set to this..

$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : '0';

No matter what if i have commented the line config.paging=true; limit allways says 0 (No paging at all)

So i do this if($limit==0){$limit=5;}

If i do not comment the config.paging variable the limit variable is set to 30.

If there a nicest way please help!!
Regards
Regards
mschering
Site Admin
Site Admin
Posts: 8284
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Generating a new module issues.

Postby mschering » Tue Apr 14, 2009 4:59 pm

That is the correct way of doing this.
Best regards,

Merijn Schering
Intermesh
ishobox
Posts: 4
Joined: Wed Jul 08, 2009 4:30 pm

Re: Generating a new module issues.

Postby ishobox » Fri Jul 10, 2009 10:32 am

Intermesh wrote: You can do a panel.load('http://mypage/index.php'); to load the html in to the panel. Please read the ExtJS docs. You could also put an iframe into the module. You can have a look at the phpbb3 module to see how that is done.

Hi, I'm trying to do that, in example:

Code: Select all

	var centerPanel = new Ext.Panel({
		region: 'north',
		baseCls:'x-plain',
		split: true,
		resizable:false		 
	});
	
	centerPanel.load('myclass.php');
But it doesn't work.

Any ideas?

Thank you!
mschering
Site Admin
Site Admin
Posts: 8284
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Generating a new module issues.

Postby mschering » Fri Jul 10, 2009 12:08 pm

What are the errors you are getting then?
Best regards,

Merijn Schering
Intermesh
cham80
Posts: 1
Joined: Fri Oct 02, 2009 10:52 am

Re: Generating a new module issues.

Postby cham80 » Fri Oct 02, 2009 10:58 am

hi,

i've been trying the panel.load('http://mypage/index.php');. i replaced it with the config.html='hello world'; and when i refresh the browser, the page doesn't load for some reason. I can't really figure out how to do it from the iframe either. Can anyone help me please. I would like to simply load a page on the testmodule.

Thank you!
mschering
Site Admin
Site Admin
Posts: 8284
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Generating a new module issues.

Postby mschering » Mon Oct 05, 2009 7:31 am

Do you use firebug to debug the javascript errors?
Best regards,

Merijn Schering
Intermesh

Who is online

Users browsing this forum: No registered users and 1 guest

cron