CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

VerticalMenu API

General discussion

by etwoss » 22 Apr 2014 14:17

Hi

Can I, in code fire the OnClick event of a verticalMenu item?

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Alexander Bulei » 23 Apr 2014 16:53

Hi Eric,

At this moment, it's only possible by javascript code.
We are thinking to implement this to facilitate the process

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by etwoss » 24 Apr 2014 07:31

Hi

Would be nice, thanks
Please also take a look in getting the Tag value of an Item into the Params

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Alexander Bulei » 24 Apr 2014 11:00

Hi Eric,

Code: Select all
2.0.0.3555

JQVertMenu
- Improved: changed the TCGCollectionItem to TCGIndexedCollectionItem
- Added: new ItemsByUniqueName method in TIWCGJQVertMenuItems
- Added: TriggerClickEvent method in TIWCGJQVertMenuItem


Please also take a look in getting the Tag value of an Item into the Params


As my colleague said, it's impossible.
You should get the "itemId" parameter from AParams, then find the item in list.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by etwoss » 24 Apr 2014 13:42

Hi

Thats what i needed to know!
Because of having muliple forms with menu and different menuitems pointing to same execution of form i now can use the tab property to indentify the form to start:

Code: Select all
procedure TIWForm6.IWCGJQVertMenu1JQVertMenuOptionsClick(Sender: TObject;
  AParams: TStringList);
var
  i : Integer;
  Clicked: Integer;
begin

  Clicked := -1;

  for i  := 0 to IWCGJQVertMenu1.Items.Count - 1 do
  begin
    if  IWCGJQVertMenu1.Items[i].UniqueName = AParams.Values['itemId'] then
    begin
      Clicked := IWCGJQVertMenu1.Items[i].Tag;
    end;
  end;

  //Now we case use a case statement to start the proper form
  case Clicked of
    -1 : begin end;
    100 : ShowMessage('100');
    200 : ShowMessage('200');
    300 : ShowMessage('300');
  end;
end;



Thanks again!

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Alexander Bulei » 24 Apr 2014 13:57

Hi Eric,

Just a note:

Since V2.0.0.3555, you are able do it like this:

delphi code
procedure TIWForm10.IWCGJQVertMenu1JQVertMenuOptionsClick(Sender: TObject; AParams: TStringList);
var
ItemID: string;
MenuItem: TIWCGJQVertMenuItem;
begin
ItemID:= AParams.Values['itemId'];
MenuItem:= IWCGJQVertMenu1.Items.ItemsByUniqueName[ItemID];
end;


Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by etwoss » 24 Apr 2014 14:23

Great thanks!
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58


Return to General - Archive

cron

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.