Page 1 of 1

TIWCGJQMenu with default TIWCGJQMenuItem.OnClick.Ajax=True

PostPosted: 04 Oct 2013 13:24
by kattunga
Hi,

TIWCGJQMenu creates MenuItems with TIWCGJQMenuItem.OnClick.Ajax=False by default.
Is there any property in TIWCGJQMenu to change this behavior?

The problem is when TIWCGJQMenu creates MenuItems from a standard VCL TMainMenu, because I need to loop through the MenuItems before rendering the page to change every automatically created TIWCGJQMenuItem.OnClick.Ajax to True.

With best regards
Christian

Re: TIWCGJQMenu with default TIWCGJQMenuItem.OnClick.Ajax=Tr

PostPosted: 04 Oct 2013 14:05
by Jorge Sousa
Hi Christian

As it is, is the only way, sorry, we cannot change it anymore without breaking users code.

Regards

Re: TIWCGJQMenu with default TIWCGJQMenuItem.OnClick.Ajax=Tr

PostPosted: 04 Oct 2013 15:36
by kattunga
No problem. I use the following code and works fine:

Code: Select all
procedure TFPrincip.IWCGJQMenu1Render(Sender: TObject);
  procedure SetAjaxTrue(submenu: TIWCGJQMenuItems);
  var
    i: integer;
  begin
    for i := 0 to submenu.Count-1 do begin
      submenu.Items[i].OnClick.Ajax := True;
      SetAjaxTrue(submenu.Items[i].SubItems);
    end;
  end;
begin
  SetAjaxTrue(IWCGJQMenu1.MenuItems);
end;


Regards