andyhill Posted December 30, 2023 Share Posted December 30, 2023 procedure TMainForm.UniFormCreate(Sender: TObject); ... ////////////////////////////////////////////////////////////////////////////// grdSuppliers.ClientEvents.ExtEvents.Clear; MyScript:= 'hide=function hide(sender, eOpts)'#10+ '{ '#10+ ' ajaxRequest(MainForm.grdSuppliers, ''_Hiding_'', []); '+ '} '; grdSuppliers.ClientEvents.ExtEvents.Add(MyScript); // MyScript:= 'show=function show(sender, eOpts)'#10+ '{ '#10+ ' ajaxRequest(MainForm.grdSuppliers, ''_Showing_'', []); '+ '} '; grdSuppliers.ClientEvents.ExtEvents.Add(MyScript); ... // ONLY EVENTS FIRED data/load/columnresize procedure grdSuppliersAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); ... ////////////////////////////////////////////////////////////////////////////// if SameText('_Hiding_', EventName) then begin // NEVER FIRES ////////////////////////////////////////////////////////////////////////////// if SameText('_Showing_', EventName) then begin // NEVER FIRES Please advise - Thanks in advance Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 31, 2023 Share Posted December 31, 2023 Hello @andyhill, What do you want to achieve? show, hide, for what? Quote Link to comment Share on other sites More sharing options...
andyhill Posted December 31, 2023 Author Share Posted December 31, 2023 I want to use these events to process some house cleaning processes Quote Link to comment Share on other sites More sharing options...
andyhill Posted January 3 Author Share Posted January 3 Can we please make Grid Hide/Show events work. MyScript:= 'show=function show(sender, eOpts)'#10+ '{ '#10+ ' ajaxRequest(MainForm.grdSuppliers, ''_Showing_'', []); '+ '} '; grdSuppliers.ClientEvents.ExtEvents.Add(MyScript); Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 4 Share Posted January 4 On 12/31/2023 at 12:09 PM, Sherzod said: show, hide, for what? 8 hours ago, andyhill said: Can we please make Grid Hide/Show events work. Now I understand that it was for the grid. Do you show/hide during runtime? Quote Link to comment Share on other sites More sharing options...
andyhill Posted January 4 Author Share Posted January 4 Grids are shown and hidden at runtime Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 4 Share Posted January 4 6 hours ago, andyhill said: Grids are shown and hidden at runtime Maybe I don't understand your case very well. Although these events works at least in runtime... Quote Link to comment Share on other sites More sharing options...
andyhill Posted January 4 Author Share Posted January 4 Sherzod, on Grids created at runtime (in FormCreate) my runtime assigned events do not fire ? If Grids are added to the Form in the IDE and Events are set in the ClientEvents Editor they do fire. FormCreate grdSuppliers:= TUniDBGrid.Create(pnlInfo); (pnlInfo is a child of MainForm) // Show grdSuppliers.ClientEvents.ExtEvents.Clear; MyScript:= 'show=function show(sender, eOpts)'#10+ '{ '#10+ ' ajaxRequest(MainForm.grdSuppliers, ''_Showing_'', []); '+ (tried different ways - NEVER FIRES) ' ajaxRequest(MainForm.pnlInfo.grdSuppliers, ''_Showing_'', []); '+ (tried different ways - NEVER FIRES) ' ajaxRequest(MainForm.window, ''_Showing_'', []); '+ (tried different ways - NEVER FIRES) ' ajaxRequest(MainForm, ''_Showing_'', []); '+ (tried different ways - NEVER FIRES) '} '; grdSuppliers.ClientEvents.ExtEvents.Add(MyScript); Please show me how to add 'Show' Event at runtime to a Grid created at runtime whose parent is pnlInfo - Thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 5 Share Posted January 5 7 hours ago, andyhill said: on Grids created at runtime (in FormCreate) my runtime assigned events do not fire ? Assign a name to the component. Quote Link to comment Share on other sites More sharing options...
andyhill Posted January 5 Author Share Posted January 5 Yes Sherzod - that was embarrassing - thank you. FYI 'show' works fine but 'hide' does not and that goes for IDE/EventEditor versions and RUNTIME/Create versions - 'show' works fine in both cases but 'hide' does not work in either. Any ideas ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 5 Share Posted January 5 Should work. Do you have a simple testcase to check!? 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.