PDA

View Full Version : getting started



sam_sam
25 Oct 2006, 8:19 AM
Hi,
Guys, I am having a serious problem in including the extension in my html file, i am not sure what files to import.
for example if i need to use the tabpanel:

// basic tabs 1, built from existing content
var tabs = new YAHOO.ext.TabPanel('tabs1');
tabs.addTab('script', "View Script");
tabs.addTab('markup', "View Markup");
tabs.activate('script');

// more advanced tabs, built from javascript
var jtabs = new YAHOO.ext.TabPanel('jtabs');
jtabs.addTab('jtabs-1', "Normal Tab", "My content was added during construction.");

according to the documentation :


Defined in TabPanel.js

Requires:

- YAHOO.ext.Element
- YAHOO.ext.UpdateManager
- YAHOO.util.Dom
- YAHOO.util.Event
- YAHOO.util.CustomEvent
- YAHOO.util.DDProxy
- YAHOO.util.Connect (optional)

I have used "TabPanel.js" but how can I include the Requires ?
including "TabPanel.js" alone was not enough.

thx.
sam.

jack.slocum
25 Oct 2006, 3:38 PM
Everything requires yui-ext-core.js (except yui-ext.js which includes it).

The others are YUI files. You can get by with yahoo.js, dom.js, event.js and optionally connection.js (for Ajax loading).

So, these are your includes:

yahoo.js
dom.js
event.js
connection.js (optional)
yui-ext-core.js
tabs-lib.js

sam_sam
26 Oct 2006, 9:54 PM
Hi jack,
Am I missing something here?
this is what I have used:


<html>
<head>
script type="text/javascript" src="yahoo.js"></script>
script type="text/javascript" src="dom.js"></script>
script type="text/javascript" src="event.js"></script>
script type="text/javascript" src="connection.js"></script>
script type="text/javascript" src="yui-ext-core.js"></script>
script type="text/javascript" src="tabs-lib.js"></script>
</head>

<body>

<script>
// basic tabs 1, built from existing content
var tabs = new YAHOO.ext.TabPanel('tabs1');
tabs.addTab('script', "View Script");
tabs.addTab('markup', "View Markup");
tabs.activate('script');

</script>

</body>
</html>
and I am getting a JS error.

(I have omited the "<" before the script so that it can be displayed in the post)

I took all the files from yui_0.11.4 except tabs and yui-ext-core from yui-ext.32.3.1.

thx for your help.
sam.

jack.slocum
27 Oct 2006, 9:20 AM
"Built from existing markup", only I don't see the elements in your file. :)