checkbox problem in Menu

I have a code like this :

menu.loadXMLString(xmlString);
menu.setOpenMode(“web”);
menu.attachEvent(“onClick”, function_A);
menu.attachEvent(“onCheckboxClick”, function_B);

When I click in checkbox item, execute function_A and function_B at the same time.

What´s wrong ?

Thanks for your help.

Nelson

it’s correct behaviour, both events are called.

You may set the check for item type in the onClick event:

function function_A(id){
if(menu.getItemType(id)!=“checkbox”){
/your code here/
}
}

Ok.

But, in this code :

function function_A(id){
if(menu.getItemType(id)!=“checkbox”){

/* 
    how can I know the item state? Here. 
*/

}

}

Thank you.

I found the solution.

I use : menu.getCheckboxState(id).

Thank you, very much.