Jump to content

How to access menu item extjs property ?


delagoutte

Recommended Posts

  • 5 weeks later...

New question :

i'm using your code like this :

procedure SetMenuItemImg(aForm : TUniForm;aMenuItem : TUniMenuItem; aSvg : string);
begin
  UniSession.AddJS(aForm.Name+'.'+aMenuItem.Name+'.setIconCls("'+UniMainModule.MainColorClass+' fs16 '+aSvg+'");');
end; 

Now my menu is on a TuniFrame. if i change uniform by uniframe it is not working.

 

How can i do it or how can i access to JSName or JsId property for my frame ?

Link to comment
Share on other sites

i call in the on framecreate.

I try this 

procedure SetMenuItemImg(aFrame : TUniframe;aMenuItem : TUniMenuItem; aSvg : string);
begin
  UniSession.AddJS(aFrame.Name+'.'+aMenuItem.Name+'.setIconCls("'+UniMainModule.MainColorClass+' fs16 '+aSvg+'");');
end; 

but it is not working.

in console :  MyFrameName is undefined. so it is the reason that i try to access to jsname or jsid because they would be unique.

Link to comment
Share on other sites

Try this:

procedure TUniMenuFrame.UniFrameAjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName='_ready' then
  begin
    UniSession.AddJS(Params.Values['_nm'] + '.owner.' + Item11.Name + '.setIconCls("testIcon")');
  end;
end;

procedure TUniMenuFrame.UniFrameCreate(Sender: TObject);
begin
  ClientEvents.ExtEvents.Add('boxready=function boxready(sender, width, height, eOpts){ajaxRequest(sender, "_ready", ["_nm="+sender.nm])}');
end;
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...