TI.ME Posted August 16, 2018 Share Posted August 16, 2018 Good Morning!!!I'm creating a Filter option in uniDbGrid in runtime ...All component connections ...The visual display is perfect, but the filter code does not work.When I type the letter no, the event is triggered but the value of the second letter on, the event is not even triggered !!!I have a project ready but I do not know how to attach in the forum !!!Could you guide me ???Unigui Version 1.10.0 Build 1469 Code Customer... procedure TMainForm.UniFormCreate(Sender: TObject); var oHidePanel : TUniHiddenPanel; oEdit : array of TUniEdit; i : integer; begin TUniHiddenPanel(oHidePanel) := TUniHiddenPanel.Create(Self); for I := 0 to Pred(UniDBGrid1.Columns.Count) do begin SetLength(oEdit,Length(oEdit)+1); TUniEdit(oEdit) := TUniEdit.Create(Self); TUniEdit(oEdit).Parent := TUniHiddenPanel(oHidePanel).Parent; TUniEdit(oEdit).Width := UniDBGrid1.Columns.Items.Width - 10; TUniEdit(oEdit).Name := 'Edit_'+IntToStr(i); UniDBGrid1.Columns.Items.Filtering.Enabled := True; UniDBGrid1.Columns.Items.Filtering.Editor := TUniEdit(oEdit); end; UniMainModule.ADOQuery1.Open; UniMainModule.ADOQuery2.Open; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 16, 2018 Share Posted August 16, 2018 Hello, Which edition are you using ?! Quote Link to comment Share on other sites More sharing options...
TI.ME Posted August 16, 2018 Author Share Posted August 16, 2018 Hello, Which edition are you using ?! Professional - 1.10.0 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 16, 2018 Share Posted August 16, 2018 Trial edition? Quote Link to comment Share on other sites More sharing options...
TI.ME Posted August 16, 2018 Author Share Posted August 16, 2018 Trial edition? No... Professional... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 16, 2018 Share Posted August 16, 2018 No... Professional... OK, can you please adjust your forum email address ?!: http://forums.unigui.com/index.php?/topic/6291-new-users-please-adjust-your-forum-email-address/ Quote Link to comment Share on other sites More sharing options...
TI.ME Posted August 23, 2018 Author Share Posted August 23, 2018 not solution? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 23, 2018 Share Posted August 23, 2018 First of all please adjust your forum email address Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted August 23, 2018 Share Posted August 23, 2018 We have a solution. After adjust email address we will share it. 1 Quote Link to comment Share on other sites More sharing options...
herculanojs Posted August 25, 2018 Share Posted August 25, 2018 Good Morning!!! I'm creating a Filter option in uniDbGrid in runtime ... All component connections ... The visual display is perfect, but the filter code does not work. When I type the letter no, the event is triggered but the value of the second letter on, the event is not even triggered !!! I have a project ready but I do not know how to attach in the forum !!! Could you guide me ??? Unigui Version 1.10.0 Build 1469 Code Customer... procedure TMainForm.UniFormCreate(Sender: TObject); var oHidePanel : TUniHiddenPanel; oEdit : array of TUniEdit; i : integer; begin TUniHiddenPanel(oHidePanel) := TUniHiddenPanel.Create(Self); for I := 0 to Pred(UniDBGrid1.Columns.Count) do begin SetLength(oEdit,Length(oEdit)+1); TUniEdit(oEdit) := TUniEdit.Create(Self); TUniEdit(oEdit).Parent := TUniHiddenPanel(oHidePanel).Parent; TUniEdit(oEdit).Width := UniDBGrid1.Columns.Items.Width - 10; TUniEdit(oEdit).Name := 'Edit_'+IntToStr(i); UniDBGrid1.Columns.Items.Filtering.Enabled := True; UniDBGrid1.Columns.Items.Filtering.Editor := TUniEdit(oEdit); end; UniMainModule.ADOQuery1.Open; UniMainModule.ADOQuery2.Open; end; tente assim: procedure TMainForm.UniFormCreate(Sender: TObject); var oHidePanel : TUniHiddenPanel; oEdit : array of TUniEdit; i : integer; begin oHidePanel := TUniHiddenPanel.Create(Self); oHidePanel.Parent := self; self.InsertControl(oHidePanel); for I := 0 to Pred(UniDBGrid1.Columns.Count) do begin SetLength(oEdit,Length(oEdit)+1); TUniEdit(oEdit) := TUniEdit.Create(Self); TUniEdit(oEdit).Parent := oHidePanel; TUniEdit(oEdit).Width := UniDBGrid1.Columns.Items.Width - 10; TUniEdit(oEdit).Name := 'Edit_'+IntToStr(i); UniDBGrid1.Columns.Items.Filtering.Enabled := True; UniDBGrid1.Columns.Items.Filtering.Editor := TUniEdit(oEdit); UniDBGrid1.Columns.Filtering.ChangeDelay := 250; end; UniMainModule.ADOQuery1.Open; UniMainModule.ADOQuery2.Open; end; Quote Link to comment Share on other sites More sharing options...
freedowsRoO Posted November 21, 2019 Share Posted November 21, 2019 On 8/23/2018 at 12:19 PM, Hayri ASLAN said: We have a solution. After adjust email address we will share it. Hello!! =] I'm with this exactly problem, i'm creating the filter in runtime and the visual are ok but the event just trigger once and de variable 'value' comes empty. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 21, 2019 Share Posted November 21, 2019 21 minutes ago, freedowsRoO said: I'm with this exactly problem, i'm creating the filter in runtime and the visual are ok but the event just trigger once and de variable 'value' comes empty. Testcase? Quote Link to comment Share on other sites More sharing options...
freedowsRoO Posted November 21, 2019 Share Posted November 21, 2019 26 minutes ago, Sherzod said: Testcase? I modified the grid filter demo to show you the problem. GridFiltering-2.rar Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 22, 2019 Share Posted November 22, 2019 15 hours ago, freedowsRoO said: I modified the grid filter demo to show you the problem. GridFiltering-2.rar procedure TMainForm.UniFormCreate(Sender: TObject); Var THidenPanel: TUniHiddenPanel; TEdit: TUniEdit; begin UniMainModule.ADOQuery1.Open; UniMainModule.ADOQuery2.Open; THidenPanel:= TUniHiddenPanel.Create(self); THidenPanel.Parent := Self; //<-------------------- THidenPanel.Name:= 'THiddenPanel'; TEdit:= TUniEdit.Create(self); TEdit.Parent:= THidenPanel; TEdit.Name:= 'TEdit'; TEdit.EmptyText:= 'teste'; if Assigned(TEdit) then begin UniDBGrid1.Columns[3].Filtering.Editor:= TEdit; UniDBGrid1.Columns[3].Filtering.Enabled:= True; end; end; 1 Quote Link to comment Share on other sites More sharing options...
freedowsRoO Posted November 22, 2019 Share Posted November 22, 2019 10 hours ago, Sherzod said: procedure TMainForm.UniFormCreate(Sender: TObject); Var THidenPanel: TUniHiddenPanel; TEdit: TUniEdit; begin UniMainModule.ADOQuery1.Open; UniMainModule.ADOQuery2.Open; THidenPanel:= TUniHiddenPanel.Create(self); THidenPanel.Parent := Self; //<-------------------- THidenPanel.Name:= 'THiddenPanel'; TEdit:= TUniEdit.Create(self); TEdit.Parent:= THidenPanel; TEdit.Name:= 'TEdit'; TEdit.EmptyText:= 'teste'; if Assigned(TEdit) then begin UniDBGrid1.Columns[3].Filtering.Editor:= TEdit; UniDBGrid1.Columns[3].Filtering.Enabled:= True; end; end; It works but when i try to create a grid at runtime it's not work.... anny ideia? GridFiltering-2.rar Quote Link to comment Share on other sites More sharing options...
freedowsRoO Posted November 22, 2019 Share Posted November 22, 2019 I DID IT! Thanks for your help 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted December 20, 2019 Share Posted December 20, 2019 Если в примере GridFilter2 на HiddenPanel кинуть TUniTreeView, то будет AccessViolation при загрузке Quote Link to comment Share on other sites More sharing options...
asapltda Posted April 28, 2020 Share Posted April 28, 2020 Good evening, could you put an example of how he did it thanks Quote Link to comment Share on other sites More sharing options...
x11 Posted April 28, 2020 Share Posted April 28, 2020 You can use the standard example "GridFiltering-2". Drop TUniTreeView on UniHiddenPanel1 and press "Run(F9)" with debug. Then open localhost:8077 in browser. Delphi Rio, UniGUI 1530, Firefox, Win 10 x64. Quote Link to comment Share on other sites More sharing options...
dmzn Posted August 5, 2021 Share Posted August 5, 2021 //Date: 2021-08-01 //Parm: FEntity.FItems索引 //Desc: 依据nIdx字典项,创建过滤组件 function TBindData.AddFilterCtrl(const nIdx: Integer): TControl; var nEdit: TUniEdit; begin if not Assigned(FFilterPanel) then begin FFilterPanel := TUniHiddenPanel.Create(FParentControl); FFilterPanel.Parent := FDBGrid.Parent; //this needs to have a parent assigned and coexist with the TUniDBGrid FFilterPanel.Visible := False; end; Result := FindFilterCtrl(nIdx); if Assigned(Result) then Exit; if not FEntity.FItems[nIdx].FQuery then Exit; nEdit := TUniEdit.Create(FParentControl); with nEdit do begin Parent := FFilterPanel; CharEOL := #13; EmptyText := 'search...'; Tag := nIdx; ClearButton := True; end; Result := nEdit; end; Quote Link to comment Share on other sites More sharing options...
=GGG= Posted August 29 Share Posted August 29 On 11/22/2019 at 10:50 AM, Sherzod said: procedure TMainForm.UniFormCreate(Sender: TObject); Var THidenPanel: TUniHiddenPanel; TEdit: TUniEdit; begin UniMainModule.ADOQuery1.Open; UniMainModule.ADOQuery2.Open; THidenPanel:= TUniHiddenPanel.Create(self); THidenPanel.Parent := Self; //<-------------------- THidenPanel.Name:= 'THiddenPanel'; TEdit:= TUniEdit.Create(self); TEdit.Parent:= THidenPanel; TEdit.Name:= 'TEdit'; TEdit.EmptyText:= 'teste'; if Assigned(TEdit) then begin UniDBGrid1.Columns[3].Filtering.Editor:= TEdit; UniDBGrid1.Columns[3].Filtering.Enabled:= True; end; end; @Sherzodдобрый день. Подскажите а высвобождение объекта TEdit происходит автоматически после уничтожения грида? или надо тоже вручную? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 29 Share Posted August 29 Добрый день, Вы имеете в виду, как объекты грида, редакторы, фильтры? Quote Link to comment Share on other sites More sharing options...
=GGG= Posted August 29 Share Posted August 29 8 minutes ago, Sherzod said: Добрый день, Вы имеете в виду, как объекты грида, редакторы, фильтры? да. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 29 Share Posted August 29 Уничтожаются автоматически. 1 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.