Jump to content

UniTreeMenu.Items.Clear not working


Ronald

Recommended Posts

1 hour ago, Sherzod said:

As you can see in below image there is a new field labeled Forum Email. Please fill in here if your forum email is different than your portal email address. If your portal email and forum email are same no action is needed:

frm.JPG

If your company has multiple licenses you can assign a new member to each license which will make you enable to assign or change forum email of each member.

Done.

Link to comment
Share on other sites

3 hours ago, Sherzod said:

Which build are you using?

This has been fixed, can you try with latest build?

Or try with this JS Code for now:


MainForm.UniTreeMenu1.Items.Clear;
MainForm.UniTreeMenu1.JSInterface.JSCode(#1'.getStore().each(function(item){item.remove()});');

 

Try  to install the latest 1.70.0.1492.
Installation didn't install the runtime packages on Delphi 10.2 Tokyo.
Try to install it manual, fail with:

[dcc32 Fataler Fehler] uniGUI25dcl.dpk(74): F2051 Unit uniToolBarEditor wurde mit einer unterschiedlichen Version von uniGUIClasses.TUniContainer compiliert

Link to comment
Share on other sites

On 3/22/2019 at 5:55 PM, Farshad Mohajeri said:

Hi,

Are you following the exact steps in the installation instructions ?

Latest version 1.70.0.1493 is working now.
The UniTreeMenu.Items.Clear is fixed.
 

Using the UnitTreeNenu demo, add a new button with the following code:

UniTreeMenu1.Items.Clear

Click that button, the Items are cleared but I get an AV while quit the application.

Edited by Ronald
Not fully working
Link to comment
Share on other sites

36 minutes ago, Farshad Mohajeri said:

I can not reproduce the AV. Can you send a test app please?

The modified Demo App is attached.
Steps: 

  1. Click the Button [Clear Nodes]
  2. Close the Webbrowser.
  3. You get an AV in Delphi.

or

  1. Click the Button [Clear Nodes]
  2. Close the Delphi Application
  3. You get an AV in Delphi

 

UniTreeMenu.7z

Link to comment
Share on other sites

  • Administrators

Please apply below fix:

destructor TWebTreeNode.Destroy;
var
  I : Integer;
  nIndex : Integer;
  FParentList : TList;
  FRootDestroying : Boolean;
begin
  with TWebTreeNodes(FOwner).FOwner as TUniCustomTreeView do
    DoDelete(Self);

  try
    FData := nil;
    FreeAndNil(FActionLink);

    if FAttachedMenuItem <> nil then
    begin
      FAttachedMenuItem.UnRegisterNode(Self);
      FAttachedMenuItem := nil;
    end;

    if TWebTreeNodes(FOwner).FClearing then
    begin
      inherited Destroy;
      Exit;
    end;

    FRootDestroying := (csDestroying in FParentTree.ComponentState);
    try
      if (FParent = nil) or (not FParent.FDestroying) then
        if (not FRootDestroying) and FParentTree.FDataLoaded then
          FParentTree.JSCallGlobal('_cnf_', [FParentTree.JSMainControl, FId, 'remove'] );
    finally

      if not FRootDestroying then
      begin
        FParentList := nil;
        if FParent=nil then
          FParentList := TWebTreeNodes(FOwner).FRootChilds
        else if not FParent.FDestroying then
          FParentList := FParent.FChildNodes;

        if FParentList <> nil then
        begin
          nIndex := FParentList.IndexOf(Self);
          FParentList.Delete(nIndex);
        end;
      end;

      FDestroying := True;

      for I := 0 to FChildNodes.Count - 1 do
        TUniTreeNode(FChildNodes[I]).Free;

      TWebTreeNodes(FOwner).FList.Remove(Self);
      inherited;
    end;
  finally
    FChildNodes.Free;
    FFont.Free;
  end;
end;

 

Link to comment
Share on other sites

  • 8 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...