jahlxx Posted December 26, 2018 Share Posted December 26, 2018 Hi. How can I know when a panel is setted to visible yes/no? Something similar to onshow or onhide (for example). Thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 26, 2018 Share Posted December 26, 2018 Hi, Do you mean events? Quote Link to comment Share on other sites More sharing options...
jahlxx Posted December 26, 2018 Author Share Posted December 26, 2018 Yes. Or something to monitor when is shown or hidden Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 26, 2018 Share Posted December 26, 2018 One possible solution using ClientEvents for this: function hide(sender, eOpts) { // ajaxRequest(...) } function show(sender, eOpts) { // ajaxRequest(...) } Quote Link to comment Share on other sites More sharing options...
jahlxx Posted December 26, 2018 Author Share Posted December 26, 2018 well. I do this in run time: UniSession.AddJS('ajaxRequest('+ unipanel1.JSName +', "bok", [])'); It works, but thene is a little delay in the action. Am I doing something wrong? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 26, 2018 Share Posted December 26, 2018 function hide(sender, eOpts) { // ajaxRequest(sender, '_hide', []); } procedure TMainForm.UniPanel1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_hide' then begin // // Your logic end; end; Quote Link to comment Share on other sites More sharing options...
jahlxx Posted December 27, 2018 Author Share Posted December 27, 2018 Ok. Thanks. Quote Link to comment Share on other sites More sharing options...
jahlxx Posted January 2, 2019 Author Share Posted January 2, 2019 On 12/26/2018 at 6:26 PM, Sherzod said: procedure TMainForm.UniPanel1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_hide' then begin // // Your logic end; end; Hi. Here, my code is execute a sql statement to load a grid, but screenmask is not shown. The same code, in a button click, shows loading in screenmask, but ajaxevent doesn't. How can I do this? Thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 2, 2019 Share Posted January 2, 2019 7 minutes ago, jahlxx said: Here, my code is execute a sql statement to load a grid, but screenmask is not shown. Hi, Sorry, where? Quote Link to comment Share on other sites More sharing options...
jahlxx Posted January 2, 2019 Author Share Posted January 2, 2019 Where you put " Your logic " Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 2, 2019 Share Posted January 2, 2019 Ok, perhaps you should use like this approach: Quote Link to comment Share on other sites More sharing options...
jahlxx Posted January 2, 2019 Author Share Posted January 2, 2019 Well. Setting the panel screenmask.enabled to true, works. I don't know if is the best way to do it. Thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 2, 2019 Share Posted January 2, 2019 4 minutes ago, jahlxx said: I don't know if is the best way to do it. I'm sorry, I don't fully understand what you want and what your issue is... Quote Link to comment Share on other sites More sharing options...
jahlxx Posted January 2, 2019 Author Share Posted January 2, 2019 Sorry, my english is not very good. When I hide the panel, I generate an ajax event. In the ajax event, I execute a query, but the screenmask is not shown. I have 2 options: - do it in the way you told me in the prior post - set the screenmask.enabled of the panel to true tested the second way, it works, but I don't know if its is the best way. But now, works, thanks. 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.