1 (edited by arubbert 2008-07-03 10:53:50 AM)

Topic: Zapatec - Menu and XAJAX

Hi all,

I have a big problem with the Zapatec Menu. I cannot disable a menu item over xajax.
Is there anybody with the same problem or can anybody help?.

The start process incl. disable the menuitem 'cwa_menu_new':
[code=PHP]
function eis_start() {
  global $smarty, $db;

  $ajaxResponse = new xajaxResponse();
  $ajaxResponse->assign("main_menu","innerHTML", $smarty->fetch('./menus/main_menu.tpl'));
  $ajaxResponse->script("var mainMenu = new Zapatec.Menu({source: 'cwa_menu', theme: './style/main.css', container: 'main_menu', hideDelay: '200'})");
  $ajaxResponse->assign("test","innerHTML", $smarty->fetch('./menus/eis_user_list_menu.tpl'));
  $ajaxResponse->script("var listMenu = new Zapatec.Menu({source: 'eis_user_list_menu', theme: './style/vert.css', vertical: true, triggerEvent: 'mouseup', triggerKey: 'right', hideDelay: '200'})");
  $ajaxResponse->script("xajax_eis_user_list('','1','','".$_SESSION['user_location']."','','1')");
  $ajaxResponse->script("mainMenu.itemDisable('cwa_menu_new')");
  return $ajaxResponse;
}
[/code]

The Menu template:

[code=HTML]
<ul id="cwa_menu" name="cwa_menu" style="display: none">
  <li id="cwa_menu_home"><a onclick="xajax_eis_start()">HOME</a></li>
  <li id="cwa_menu_file">File
    <ul>
      <li id="cwa_menu_new"><img src="./images/icon_new.gif"><a onclick="xajax_eis_user_new()">New</a></li>
      <li id="cwa_menu_edit"><img src="./images/icon_edit.gif"><a onclick="xajax_eis_user_new()">Edit</a></li>
      <li id="cwa_menu_delete"><img src="./images/icon_delete.gif">Delete</li>
    </ul>
  </li>
  <li>Programs
    <ul>
      <li id="cwa_menu_eis"><a onclick="xajax_eis_start()"><u>E</u>mployee