*newbie* Can't add toolbar buttons to Treepanel

  • I read that in the properties of the Treepanel you can add buttons to it.
    But if I add a button to my treepanel it is displayed at the bottom (like a submit button).
    I want to have toolbarbuttons (under the treepanel title) with icon (later I want to add dropdowns if possible)

    What am I doing wrong? :-?

    var tree = new Tree.TreePanel({
    title: 'Template Structure',
    el:'tree-div',
    useArrows:true,
    autoScroll:true,
    animate:true,
    enableDD:true,
    containerScroll: true,
    split : true,
    // auto create TreeLoader
    dataUrl: 'treeloader.php',
    rootVisible : true,
    root: {
    nodeType: 'async',
    text: 'template',
    draggable:false,
    id:'source'
    },
    buttons: [{text: "blah"} ]

    });


  • Allright I will figure it out! Thanks for the fast reply!


  • For those who are interested:

    var tree = new Tree.TreePanel({
    title: 'Template Structure',
    el:'tree-div',
    useArrows:true,
    autoScroll:true,
    animate:true,
    enableDD:true,
    containerScroll: true,
    split : true,
    // auto create TreeLoader
    dataUrl: 'treeloader.php',
    rootVisible : true,
    root: {
    nodeType: 'async',
    text: 'template',
    draggable:false,
    id:'source'
    },
    tbar: [ {
    text: 'file',
    iconCls: 'my-icon',
    handler: function() {

    }
    },

    {
    xtype: 'tbseparator'
    }]
    ,
    buttons: [{text: 'Save'}]
    });


  • Use:
    tbar: [{
    text: 'blabla',
    iconCls: 'my-icon',
    menu: new Ext.menu.Menu({...}
    }]







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about *newbie* Can't add toolbar buttons to Treepanel , Please add it free.

    13 March 2010 | cameltoepants.com | edit