TI.ME Posted August 16, 2018 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
TI.ME Posted August 16, 2018 Author Posted August 16, 2018 Hello, Which edition are you using ?! Professional - 1.10.0 Quote
TI.ME Posted August 16, 2018 Author Posted August 16, 2018 Trial edition? No... Professional... Quote
Sherzod Posted August 16, 2018 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
Sherzod Posted August 23, 2018 Posted August 23, 2018 First of all please adjust your forum email address Quote
Hayri ASLAN Posted August 23, 2018 Posted August 23, 2018 We have a solution. After adjust email address we will share it. 1 Quote
herculanojs Posted August 25, 2018 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
freedowsRoO Posted November 21, 2019 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
Sherzod Posted November 21, 2019 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
freedowsRoO Posted November 21, 2019 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
Sherzod Posted November 22, 2019 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
freedowsRoO Posted November 22, 2019 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
x11 Posted December 20, 2019 Posted December 20, 2019 Если в примере GridFilter2 на HiddenPanel кинуть TUniTreeView, то будет AccessViolation при загрузке Quote
asapltda Posted April 28, 2020 Posted April 28, 2020 Good evening, could you put an example of how he did it thanks Quote
x11 Posted April 28, 2020 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
dmzn Posted August 5, 2021 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
turan Posted August 29, 2023 Posted August 29, 2023 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
Sherzod Posted August 29, 2023 Posted August 29, 2023 Добрый день, Вы имеете в виду, как объекты грида, редакторы, фильтры? Quote
turan Posted August 29, 2023 Posted August 29, 2023 8 minutes ago, Sherzod said: Добрый день, Вы имеете в виду, как объекты грида, редакторы, фильтры? да. Quote
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.