context menu onclick function

I have something like the following:



                        menu=new dhtmlXMenuObject();

                        menu.renderAsContextMenu();

                        menu.loadXMLString(’’);

                                                            menu.attachEvent(“onClick”, function(id,zoneid){

                            alert(“element “+id+” was clicked and zone “+zoneid+” was clicked”);

                         });



The alert returns “element add_footer was clicked and zone false was clicked”.



It says that onclick passes both parameters only in case of a Contextual Menu which is what I declared mine as.

Am I doing something wrong here? thanks in advance.





                        

Right,

zoneid is an id of context zone
context zone: dhtmlx.com/docs/products/dhtmlxM … 5382786000
You didn’t assing any context zones to menu so you have such result. Behaviour is correct.


After I build my grid, I have the following code:



 



grids.enableContextMenu(menu);



menu.attachEvent(“onClick”, onMenuClick);



 



Still returns ‘false’ as second parameter, wonder why?

Problem confirmed. You can use

grids.contextID inside event to receive necessary info, or contact us directly at support@dhtlmx.com , we will provide update which will restore sending ID as second parameter of onclick method.