jQuery.fn.hider = function(options)
{
return this.each(function(){
// hide the element and its parent
var hide = options.tohide(this);
var click = options.toclick ? options.toclick(this) : this;
if(options.hide) jQuery(hide).hide();
jQuery(click).click(function()
{
if(options.effect == 'slide')
{
jQuery(hide).slideToggle('fast');
}else{
jQuery(hide).animate({opacity:'toggle'},'fast');
}
return false;
});
});
}
var tree = new Ext.tree.TreePanel({
el:'tree',
animate:true,
autoScroll:true,
loader: new Ext.tree.TreeLoader({dataUrl:'/server/script'}),
enableDD:true,
containerScroll: true,
dropConfig: {appendOnly:true} });
// set the root node
var root = new Ext.tree.AsyncTreeNode({
text: 'Ext JS',
draggable:false, // disable root node dragging
id:'source
tree.setRootNode(root);
// render the tree
tree.render();
root.expand(false, /*no anim*/ false);
var Person = new Class({
initialize: function(name){
this.name = name; }
});
// An XHR DataSource
var myServer =
var mySchema = [quot;ResultItemquot;,
quot;KeyDataFieldquot;];
var myDataSource = new YAHOO.widget
.DS_XHR(myServer, mySchema);