Page 1 of 1

MenuItems OnClick Event

PostPosted: 17 Dec 2015 10:15
by feland
Hi
I have a TIWCGJQMenuItem,
There is a way to run the event on click of the item without phisically click on the item menu?

For the button I'm doing this:
Code: Select all
 btnConfirm.TriggerEventInBrowser(jqbtnateClick);


There is a similar way for the item Menu??

Is very URGENT,

Thanks,
feland

Re: MenuItems OnClick Event

PostPosted: 17 Dec 2015 11:15
by assapan
Hi feland,
Do you need this to be executed on client or server ?
Could explain more deeply your need ?

Re: MenuItems OnClick Event

PostPosted: 17 Dec 2015 11:51
by feland
On client.
This event permits me to create a new frame into the main form.

Following the event that i will call (procedure TfrmMain.MenuIWCGJQMenuItems1Click(Sender: TObject; AParams: TStringList);)
Code: Select all
procedure TfrmMain.MenuIWCGJQMenuItems1Click(Sender: TObject; AParams: TStringList);
var
  MenuItem: TIWCGJQMenuItem;
begin
  try
    MenuItem := Sender as TIWCGJQMenuItem;
    CreateTabFrame(MenuItem.MenuItemName);
  except
    on e: exception do
    begin
      InsertErrorLog('EXCEPTION: Error in MenuIWCGJQMenuItems1Click(uMainForm): ' + e.Message);
      CreateMsgDlg(DlgError,
        'A technical error has occurred. Please try again in a few minutes. If the problem persist contact technical support');
    end;
  end;
end;

Re: MenuItems OnClick Event

PostPosted: 17 Dec 2015 11:59
by assapan
So this is at server side , not handled by a javascript .

you can call MenuIWCGJQMenuItems1Click(MyMenuItem,Nil); this will operate the "MyMenuItem" click

Re: MenuItems OnClick Event

PostPosted: 17 Dec 2015 16:00
by Alexander Bulei
Hi feland,

You don't need it.
Just "isolate" the code into private/public procedure, and call then you need.

Best Regards.

Re: MenuItems OnClick Event

PostPosted: 17 Dec 2015 16:02
by feland
Thanks