Skip to forum content

Mif

— mystic javascript interface

You are not logged in. Please login or register.


Post new reply

Post new reply

Compose and post your new reply

You may use: BBCode Images Smilies

All fields labelled (Required) must be completed before the form is submitted.

Required information for guests



Captcha image. Turn pictures on to see it.
Required information
Optional post settings

Topic review (newest first)

1

moro,

Suppose I initialize context menu with one element:

list: {
    items: [
    {
        name: 'new: ONE',
        onAction: function(){
            alert('new');
            }
        }
    ]
}

It is attached to a DIV element (displayed on left-click), showing and works fine.

Now, I need to replace 'new: ONE' with 'new: TWO' element:

items: [
{
    name: 'new: ONE',
    onAction: function(){
        alert('new');
        }
    }
]

How can I do it without totally re-instantiating the whole class. Is there a method to "update" the existing menu based on new 'list' parameter?

For example, I need to update menu items based on a state of other page components. If there's more that one item selected on the page - menu should have "DELETE ALL" entry dynamically inserted after "DELETE".

Thanks