Tabbed-Pane Requst

thread: 23 messages  |  last: about 5 years ago  |  started: thursday, june 22, 2006, 8:38 am pdt


#1  |  freakazoid3 (Nicosia, Cyprus) Cyprus
Thursday, June 22, 2006, 8:38 AM PDT

Is there a Qform object that can work as a tabbed-pane? I.e you would be able to put a load of Qform objects on each pane and view a completely different set of Qform objects by clicking on a different tab.  Obviously all the qform objects would be on the one QForm, but you would only be able to see a subset when you press a specific tab name.

Thanks

#2  |  Kristof Meirlaen (Belgium) Belgium Qcodo Core Contributor
Thursday, June 22, 2006, 8:56 AM PDT

Hi,

You could create some QPanels and then create the controls you need and load them on the QPanel.
You then could show/hide the panels according to your needs...

Kristof

#3  |  Hunter Jensen (San Diego, CA) United States of America Qcodo Core Contributor
Thursday, June 22, 2006, 12:12 PM PDT

If you need more functionality than the QPanel offers, then you can also try creating composite controls. You load the composite controls on page load, and then display/hide the controls as necessary.

-- Hunter

#4  |  Mike Hostetler (Denver, CO) United States of America Qcodo Administrator
Friday, June 23, 2006, 2:31 PM PDT

I've got a BETA version of a tabbed pane available.  It is implemented as a QControl, but it might be what you need.

Please email me at my website <http://www.amountaintop.com> and I'll package it up and send it over.

Mike

#5  |  Mike Hostetler (Denver, CO) United States of America Qcodo Administrator
Monday, June 26, 2006, 10:34 AM PDT

UPDATE

I've posted the tab panel on my blog.  Please feel free to email me with patches or suggestions.

<http://www.amountaintop.com/qtabpanel-jquery-tab-panel-for-qcodo>

Mike

#6  |  Martin Kronstad (Mjoendalen) Norway Qcodo Core Contributor
Monday, June 26, 2006, 1:15 PM PDT

Hi!

I have only one comment to this, and that is the <style> tags in the middle of the code that gets generated, I would like to see this in my < head > tag instead. Is there some place where I can say do not output css or something?

Does it need to be an ID and not a class for the css? Maybe we could set something like this instead:

<div class=“someclass”> and when the tab is selected we could do <div class=“someclass tab_selected”>. Then we could control the classes from the stylesheet. In fact all css should be in an <style> or at the best in an external file.

I would bet my car on the fact that my designers would nag me about this. My designers are controlfreaks :)

I made a small change to the example.php file to make it integrate better to qcodo:

1<?php
2    
require_once('prepend.inc');
3    //require_once("QTabPanel.inc");
4    //require_once("QTabPanelSection.inc");

I removed the require_once lines, then copyed the files into the qform folder. Then it gets autoincluded by qcodo :)

I also made a small installguide....

QTabPanel Readme
===========================================

Howto install:
1. Put the example.php and settings.inc.php in some subfolder of wwwroot, example: wwwroot/QTabPanelTest
2. Put the .js files in the wwwroot/includes/qform/assets
3. Put the QTabPanel.inc and QTabPanelSection.inc in wwwroot/includes/qform

Then point your browser at the example.php file. (In my example : http://yourdomain.com/QTabPanelTest/example.php)


To see a working example check out: http://qcodo_cvs.box3.prosjektweb.net/QTabPanelTest/example.php.

#7  |  alex94040 (Seattle, WA) United States of America Qcodo Core Contributor
Friday, July 14, 2006, 2:29 AM PDT

Martin, the example link you posted doesn't work (http://qcodo_cvs.box3.prosjektweb.net/QTabPanelTest/example.php) - dies with a 'divide by zero' exception.

#8  |  Martin Kronstad (Mjoendalen) Norway Qcodo Core Contributor
Tuesday, July 18, 2006, 5:35 AM PDT

This has been fixed.

#9  |  gibran (Paris) Lebanon
Tuesday, July 25, 2006, 4:12 PM PDT

Mike
Great stuff there with the QTabPanel, just 2 remarks:
1/ isn't it overkill to load all the 10k .js for only tab switching? can't we just use the correct portion of the library ?
2/ about the :

<?php
//Not sure of the correct way to do a negative instanceof
if($objParentObject instanceof QTabPanel) {

why not just:

<?php
if(!($objParentObject instanceof QTabPanel)) {

? :)
Cheers

#10  |  Mike Hostetler (Denver, CO) United States of America Qcodo Administrator
Wednesday, July 26, 2006, 6:51 AM PDT

Gibran-

Good points!

First, regarding the javascript library.  The big hit is jQuery, which is 10k.  This might seem a bit heavy for simple tabbed functionality, but I've got a few other plugins in the works that make use of jQuery, thus the cost is spread over a few different components.  I also look at it as a difference between jQuery and the Prototype/Scriptaculous/OpenRico/Behavior stack.  I don't know how big all of those files are, but I'll take the 10K in comparison.

Secondly, I'll make the switch in the code for the negative instance of, thanks for the tip.



Copyright © 2005 - 2012, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.