Actions

J1.5

Difference between revisions of "Using the JPane classes in a component"

From Joomla! Documentation

m
Line 14: Line 14:
 
You can set some options in the getInstance method.
 
You can set some options in the getInstance method.
 
== JPaneTabs options ==
 
== JPaneTabs options ==
startOffset:  The default tab to start with
+
'''startOffset''':  The default tab to start with.<br/>
onActive: Another function to use when making a tab active (??)
+
'''onActive''': Another function to use when making a tab active (??)<br/>
onBackground:  Another function to use when making a tab dissapear (??)
+
'''onBackground''':  Another function to use when making a tab dissapear (??)<br/>
  
 
== Example ==
 
== Example ==
<source lang="php">$pane =& JPane::getInstance('tabs', array('startOffset'=>2)); //'tabs' or 'sliders' //2: starting with third tab as the default / open one!
+
<source lang="php">
 +
jimport('joomla.html.pane');
 +
//1st Parameter: Specify 'tabs' as appearance
 +
//2nd Parameter: Starting with third tab as the default (zero based index)
 +
//open one!
 +
$pane =& JPane::getInstance('tabs', array('startOffset'=>2));  
 
echo $pane->startPane( 'pane' );
 
echo $pane->startPane( 'pane' );
 
echo $pane->startPanel( 'Example Panel 1', 'panel1' );
 
echo $pane->startPanel( 'Example Panel 1', 'panel1' );
Line 27: Line 32:
 
echo "This is panel2";
 
echo "This is panel2";
 
echo $pane->endPanel();
 
echo $pane->endPanel();
echo $pane->endPane();</source>''Don't forget the echo's!! Thanks to tcp for this post: [http://forum.joomla.org/viewtopic.php?f=231&t=135641#p664869 FYI - Change in usage of JPane]
+
echo $pane->startPanel( 'Example Panel 3', 'panel3' );
 +
echo "This is panel3";
 +
echo $pane->endPanel();
 +
echo $pane->endPane();
 +
</source>
 +
''Don't forget the echo's!! Thanks to tcp for this post: [http://forum.joomla.org/viewtopic.php?f=231&t=135641#p664869 FYI - Change in usage of JPane]
 
Also notice that the useCookies in the comments in the code or on the api, do NOT seem to be implemented''
 
Also notice that the useCookies in the comments in the code or on the api, do NOT seem to be implemented''

Revision as of 02:27, 9 July 2008

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.


JPane class types include 'Tabs' and 'Sliders'.

Sliders implement the mootools accordian effect. Examples are the Joomla Admin parameters settings. Tabs also implement mootools (but in which degree?)

startPane and endPane() require a string identifier.

JPanes contain Panels

startPanel() and endPanel() require name and ID parameters.

You can set some options in the getInstance method.

JPaneTabs options

startOffset: The default tab to start with.
onActive: Another function to use when making a tab active (??)
onBackground: Another function to use when making a tab dissapear (??)

Example

jimport('joomla.html.pane');
//1st Parameter: Specify 'tabs' as appearance 
//2nd Parameter: Starting with third tab as the default (zero based index)
//open one!
$pane =& JPane::getInstance('tabs', array('startOffset'=>2)); 
echo $pane->startPane( 'pane' );
echo $pane->startPanel( 'Example Panel 1', 'panel1' );
echo "This is panel1";
echo $pane->endPanel();
echo $pane->startPanel( 'Example Panel 2', 'panel2' );
echo "This is panel2";
echo $pane->endPanel();
echo $pane->startPanel( 'Example Panel 3', 'panel3' );
echo "This is panel3";
echo $pane->endPanel();
echo $pane->endPane();

Don't forget the echo's!! Thanks to tcp for this post: FYI - Change in usage of JPane Also notice that the useCookies in the comments in the code or on the api, do NOT seem to be implemented