<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Mifjs forum — Mif.Tree, Mif.Menu - MifMenu - update of tree structure]]></title>
	<link rel="self" href="http://www.mifjs.net/forum/feed/atom/topic/56/"/>
	<updated>2008-10-26T20:45:13Z</updated>
	<generator>PunBB</generator>
	<id>http://mifjs.net/forum/topic/56/</id>
		<entry>
			<title type="html"><![CDATA[MifMenu - update of tree structure]]></title>
			<link rel="alternate" href="http://mifjs.net/forum/post/203/#p203"/>
			<content type="html"><![CDATA[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]]></content>
			<author>
				<name><![CDATA[temuri]]></name>
				<uri>http://mifjs.net/forum/user/4/</uri>
			</author>
			<updated>2008-10-26T20:45:13Z</updated>
			<id>http://mifjs.net/forum/post/203/#p203</id>
		</entry>
</feed>

