Results 1 to 2 of 2

Thread: Get the selected menu

  1. #1

    Default Get the selected menu

    I have the Layout Browser example from sencha docs, and when i press on the tree menu, its open a form, that has the items:

    HTML Code:
    {                        x: 10,                        y: 33,                        xtype: 'label',
                            text: 'Description:'                    },Ext.create('Ext.form.HtmlEditor', {                        x:5,                        y:55,                        hideLabel: true,                        name:'description',                        allowBlank:false,                        height: 450,                        anchor: '100%',                        plugins: [new Ext.create('Ext.ux.form.HtmlEditor.imageUpload', {managerUrl:'/admin/htmleditor/'+getSelectedMenu()})]                    }
    where getSelectedMenu() take the qtitle of the tree menu like this:

    HTML Code:
    function getSelectedMenu(){        var nodes=Ext.getCmp('tree-panel').getSelectionModel().getLastSelected();    if(nodes){        var menuSelected=Ext.getCmp('tree-panel').getSelectionModel().getLastSelected().data.qtitle;            }    console.log(menuSelected);    return menuSelected;}
    The problem is that when i access the function getSelectedMenu when the HtmlEditor is shown, appear at managerUrl something like this:
    /admin/htmleditor/undefined.

    If i acces getSelectedMenu when i click a menu, then is ok, but on htmleditor appear undefined.
    This plugin, is to upload pictures, and i want to send the url where to upload data.

    Thanks.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716

    Default

    You do not have a qualifier for getSelectedMenu()

    Regards,
    Scott.

Posting Permissions

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