Ajax + Context Menu
2008/07/11 00:38
Viewed 2832 times
Replies: 1/2

I am using this to create a context menu on a list that is generated with jquery/ajax. On a successful ajax request I fire the DynarchMenu.setup('menu1',{params}). And this works just fine. However, if I update the list in anyway (column sort, go to next page) that does not require a complete page reload, jsut the ajax to fire and update the list I get the "Error: menu element not found". Why is it doing this? The script, even on ajax pefrorms the Menu.setup function as a final step. Is there some way to get the menu to work with ajax?

Re: Ajax + Context Menu
2008/07/11 23:04
Viewed 4508 times
Replies: 1/1

ok, i have narrowed it down to a line of code. It is:

if(typeof el=="string")el=window.self.document.getElementById(el);

I have checked the function and I am passing a string so I guess that the function cannot find the Element by ID. On ajax reload. any suggestions?

last
Re[2]: Ajax + Context Menu
2008/07/14 16:49
Viewed 6291 times
Replies: 0/0

another day of looking into this:

I think what is happening is when the page loads the dynarch creates a class in javascript for DynarchMenu. This is stored in the javascript. The UList at this point is destroyed as it was. So I am creating a UL class with an id of "menu1". The page when it loads is creating a DynarchMenu and destroying the list. So on ajax requests, I am asking for a new list using "menu1", but now the html 'menu1' is nonexistant.

So I need to either
A) reference the DynarchMenu that was created and tell it to load new data,
B) not delete the List on creation so that the page can rebuild it on every ajax request.

Ideas or suggestions?

last
Google