Results 1 to 2 of 2

Thread: custom menu items

  1. #1

    Default custom menu items

    hi there, i'm trying to make a server side structure to be used as a client side menu item

    server side
    Code:
    [Serializable]
        public struct ContextMenuItem
        {
            public string text;
            public string handler;
        }

    client side
    Code:
    var itemmenu_custom = new Ext.menu.Menu();
    if (record.get('contextmenu') != null)
    {
              for(var ctr = 0; ctr < record.get('contextmenu').length; ctr++)
              {
                  itemmenu_custom.add({text:record.get('contextmenu')[ctr].text, handler:new Function(record.get('contextmenu')[ctr].handler)});
               }
               itemmenu_custom.showAt(e.getXY());
    }
    the menu is showing up but the handler is not firing, what am i missing, and also how can i add multiple handlers per menu item?

  2. #2

    Default

    got the answer from this one

    http://www.extjs.com/forum/showthread.php?t=61674

    used this code instead
    Code:
    itemmenu_custom.add({text:record.get('contextmenu')[ctr].text, handler:eval("record.get('contextmenu')[ctr].handler = "+ record.get('contextmenu')[ctr].handler)});
    but how can i add multiple event listener from the server side since this is only adding the click event handler?

Posting Permissions

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