IdrisZZ Posted September 16, 2022 Share Posted September 16, 2022 How do I make a search in UniTreeMenu like UnitreeView1 ? Quote Link to comment Share on other sites More sharing options...
picyka Posted September 16, 2022 Share Posted September 16, 2022 1 minuto atrás, IdrisZZ disse: Como faço uma pesquisa no UniTreeMenu como o UnitreeView1? I was never able to do this in UniTreeMenu, my way out was to throw the menus in a combo Quote Link to comment Share on other sites More sharing options...
IdrisZZ Posted September 16, 2022 Author Share Posted September 16, 2022 execuse me, how to make it look like a tree menu ? Quote Link to comment Share on other sites More sharing options...
picyka Posted September 16, 2022 Share Posted September 16, 2022 1 minuto atrás, IdrisZZ disse: me execuse, como fazê-lo parecer um menu de árvore? I use it with a UniComboBox Quote Link to comment Share on other sites More sharing options...
IdrisZZ Posted September 16, 2022 Author Share Posted September 16, 2022 I can't make a combobox like a tree menu. please give an example, thank you Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 16, 2022 Share Posted September 16, 2022 1 hour ago, IdrisZZ said: How do I make a search in UniTreeMenu like UnitreeView1 ? Hello, Sorry, can you please specify an edition and build of uniGUI you are using? Quote Link to comment Share on other sites More sharing options...
IdrisZZ Posted September 16, 2022 Author Share Posted September 16, 2022 I'm using uniGUI Complete Edition 1.90.0.1554 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 16, 2022 Share Posted September 16, 2022 Okay. Please adjust your forum email address. Quote Link to comment Share on other sites More sharing options...
Muhammad Idris Posted September 17, 2022 Share Posted September 17, 2022 I'm using uniGUI Complete Edition 1.90.0.1554 ok, this is my email Quote Link to comment Share on other sites More sharing options...
Muhammad Idris Posted September 19, 2022 Share Posted September 19, 2022 On 9/16/2022 at 6:58 PM, Sherzod said: Hello, Sorry, can you please specify an edition and build of uniGUI you are using? ok, this is my email here I have used my email Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 19, 2022 Share Posted September 19, 2022 2 minutes ago, Muhammad Idris said: this is my email here I have used my email Hi Muhammad, Okay, need to check. Quote Link to comment Share on other sites More sharing options...
Muhammad Idris Posted September 22, 2022 Share Posted September 22, 2022 On 9/16/2022 at 6:58 PM, Sherzod said: Hello, Sorry, can you please specify an edition and build of uniGUI you are using? I've tried using this code but it doesn't work Treemenu_Search.zip Quote Link to comment Share on other sites More sharing options...
Muhammad Idris Posted September 26, 2022 Share Posted September 26, 2022 On 9/19/2022 at 4:11 PM, Sherzod said: Hi Muhammad, Okay, need to check. sorry sir, is there any solution for searching in treemenu Quote Link to comment Share on other sites More sharing options...
Luciano França Posted May 22, 2023 Share Posted May 22, 2023 On 9/19/2022 at 6:11 AM, Sherzod said: Hi Muhammad, Okay, need to check. hello i need some solution Grateful. Quote Link to comment Share on other sites More sharing options...
Luciano França Posted May 22, 2023 Share Posted May 22, 2023 41 minutes ago, Luciano França said: hello i need some solution Grateful. Solution procedure TMainForm.Ed_BuscaChange(Sender: TObject); var I, tamanho: Integer; no: TUniTreeNode; TextoNode: String; begin tamanho := Length(Ed_Busca.Text); if tamanho > 0 then for I := 0 to UniTreeMenu1.Items.Count - 1 do Begin TextoNode := AnsiUpperCase(UniTreeMenu1.Items[I].Text); if Pos(AnsiUpperCase(Ed_Busca.Text), TextoNode) > 0 Then Begin no := UniTreeMenu1.Items[I]; UniTreeMenu1.Selected := no; Break; end; End; if Trim(Ed_Busca.Text) = EmptyStr Then UniTreeMenu1.JSInterface.JSCall('rootItem.getNode().collapseChildren', [True]); end; Quote Link to comment Share on other sites More sharing options...
Muhammad Idris Posted June 11, 2023 Share Posted June 11, 2023 On 5/23/2023 at 4:31 AM, Luciano França said: Solution procedure TMainForm.Ed_BuscaChange(Sender: TObject); var I, tamanho: Integer; no: TUniTreeNode; TextoNode: String; begin tamanho := Length(Ed_Busca.Text); if tamanho > 0 then for I := 0 to UniTreeMenu1.Items.Count - 1 do Begin TextoNode := AnsiUpperCase(UniTreeMenu1.Items[I].Text); if Pos(AnsiUpperCase(Ed_Busca.Text), TextoNode) > 0 Then Begin no := UniTreeMenu1.Items[I]; UniTreeMenu1.Selected := no; Break; end; End; if Trim(Ed_Busca.Text) = EmptyStr Then UniTreeMenu1.JSInterface.JSCall('rootItem.getNode().collapseChildren', [True]); end; but the other items are not lost or hidden. Thank You Quote Link to comment Share on other sites More sharing options...
Luciano França Posted June 12, 2023 Share Posted June 12, 2023 On 6/11/2023 at 9:13 AM, Muhammad Idris said: but the other items are not lost or hidden. Thank You procedure TForm_BuscaMainMenuHost.Ed_BuscaChange(Sender: TObject); var I, tamanho: Integer; TextoNode: String; Achou: Boolean; begin Achou := false; tamanho := Length(Ed_Busca.Text); if tamanho >= 4 then for I := 0 to DBTreeList.Items.Count - 1 do Begin TextoNode := AnsiUpperCase(DBTreeList.Items[I].Text); if Pos(AnsiUpperCase(Ed_Busca.Text), TextoNode) > 0 Then Begin DBTreeList.Selected := DBTreeList.Items[I]; DBTreeList.Selected.Expand(false); Achou := True; Break; end; End; if (trim(Ed_Busca.Text) = EmptyStr) Or (Not Achou) Then DBTreeList.JSInterface.JSCall('rootItem.getNode().collapseChildren', [True]); end; Quote Link to comment Share on other sites More sharing options...
Muhammad Idris Posted June 13, 2023 Share Posted June 13, 2023 12 hours ago, Luciano França said: procedure TForm_BuscaMainMenuHost.Ed_BuscaChange(Sender: TObject); var I, tamanho: Integer; TextoNode: String; Achou: Boolean; begin Achou := false; tamanho := Length(Ed_Busca.Text); if tamanho >= 4 then for I := 0 to DBTreeList.Items.Count - 1 do Begin TextoNode := AnsiUpperCase(DBTreeList.Items[I].Text); if Pos(AnsiUpperCase(Ed_Busca.Text), TextoNode) > 0 Then Begin DBTreeList.Selected := DBTreeList.Items[I]; DBTreeList.Selected.Expand(false); Achou := True; Break; end; End; if (trim(Ed_Busca.Text) = EmptyStr) Or (Not Achou) Then DBTreeList.JSInterface.JSCall('rootItem.getNode().collapseChildren', [True]); end; I mean, for example, if you type Labora, the other items will automatically disappear because there are many items in the treemenu. Thank You Treemenu_Search_1.zip Quote Link to comment Share on other sites More sharing options...
Muhammad Idris Posted June 13, 2023 Share Posted June 13, 2023 like this treeview when typed in "ope" it will display the appropriate one Quote Link to comment Share on other sites More sharing options...
Luciano França Posted June 17, 2023 Share Posted June 17, 2023 I advise the colleague to change his approach It would be better to have a TClientDataset to be able to do a more elaborate search and link to a "TUniDbTreeGrid" and you could put some CSS to make it look like "TUniTreeMenu" I have it here and it works perfectly for Accounting Plan For my Main menu I did a simple search but as my system has few items there is no problem with the search I put the code for. 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.