fabiotj Posted July 5, 2019 Share Posted July 5, 2019 I used the same search / filter example from the TreeView Demo for a TUniTreeMenu, but the search result is added to the different TreeView menu which deletes / hides the unseen results see the image and the code used. What do I need to do to fix this? Function of Search: procedure TfrmMainForm.SearchTreeMenu(const AText: string); var S, SString : string; I : Integer; aExpand : Boolean; begin SString := Trim(AText); if SString<>PSString then begin PSString := LowerCase(SString); if (Length(PSString) > 1) or (PSString = '') then begin aExpand := PSString<>''; UniTreeMenuPrincipal.BeginUpdate; try UniTreeMenuPrincipal.ResetData; for I := 0 to UniTreeMenuPrincipal.Items.Count - 1 do begin S := LowerCase( UniTreeMenuPrincipal.Items.Text); UniTreeMenuPrincipal.Items.Visible := (Length(PSString) = 0) or (Pos(PSString, S) >0); UniTreeMenuPrincipal.Items.Expanded := aExpand; end; finally UniTreeMenuPrincipal.EndUpdate; end; end; end; end; -------------------- CSS used: / * UniTreeMenu - ServerModule-->CSS * / .x-treelist-nav {/ * Here it determines the BACKGROUND COLOR of the menu * / background-color: # 414141! important; / * # 32404e; moccasin; * / background-position: 24px 0%! important; padding: 0 0 0 0; overflow: auto! important; scrollbar-width: thin; / * scrool style for mozilla * / scrollbar-color: # adb3b8 # 516579; / * scrool style for mozilla * / } .x-treelist-nav :: - webkit-scrollbar {width: 7px; height: 7px; background: # 516579;} .x-treelist-nav :: - webkit-scrollbar-track {background: rgba (0,0,0,0,1);} .x-treelist-nav :: - webkit-scrollbar-thumb {border-radius: 7px; height: 7px; background: # adb3b8;} .x-treelist-nav .x-treelist-item-text { / * left side menu * / color: # adb3b8; / * menu letter color * / margin-left: 12px; / * 27 Left-to-right spacing of menu items * / margin-right: 26px; / * left-to-right spacing from menu groups * / font-size: 12px; / * font size * / line-height: 34px; / * height of menu line * / } .x-treelist-nav .x-treelist-item-icon: before, .x-treelist-nav .x-treelist-item-tool: line-height: 34px; / * 44 is the default * / } Thanks in advance for your help. Quote Link to comment Share on other sites More sharing options...
fabiotj Posted July 5, 2019 Author Share Posted July 5, 2019 Other users have a similar problem: Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted July 6, 2019 Share Posted July 6, 2019 Can you try this on "AdvMainMenu1" I mean, first "UniTreeMenuPrincipal.SourceMenu:= nil;" then run your filter code on AdvMainMenu1. Then finally reSet "UniTreeMenuPrincipal.SourceMenu:= AdvMainMenu1;" I can not test on lastunigui sorry, I have 1484. Quote Link to comment Share on other sites More sharing options...
fabiotj Posted July 8, 2019 Author Share Posted July 8, 2019 Thanks for the suggestion, I tried it now a little but it did not work. Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted August 23, 2019 Share Posted August 23, 2019 On 7/8/2019 at 1:32 PM, fabiotj said: Thanks for the suggestion, I tried it now a little but it did not work. did you manage to solve it? Quote Link to comment Share on other sites More sharing options...
mikromundo Posted August 30, 2019 Share Posted August 30, 2019 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.