Results 1 to 2 of 2

Thread: Add button to toolbar of FormPanel at runtime

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    59

    Default Answered: Add button to toolbar of FormPanel at runtime

    Can someone help me to add a button on runtime to the toolbar of a FormPanel? So that the new button will be added close the other buttons (e.g. send, cancel) of the form.
    As you can see on my attached picture.button_toolbar.jpg

    The predefined buttons have been added as follows to the form:
    Code:
    buttons: [{
        text: 'Send'
    },{
        text: 'Cancel'
    }]
    Thanks for your help!extjser12

  2. Have a try with:
    Code:
    var toolBar = <form>.getDockedItems('toolbar[ui=footer]')[0];
    toolBar.add({
        xtype: 'button',
        text: 'New button',
        ...
    });

  3. #2
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347

    Default

    Have a try with:
    Code:
    var toolBar = <form>.getDockedItems('toolbar[ui=footer]')[0];
    toolBar.add({
        xtype: 'button',
        text: 'New button',
        ...
    });

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •