Roberto Nicchi Posted September 28, 2021 Share Posted September 28, 2021 Hello, Does the grid enhancements (2021 Roadmap) will include the implementation of onenter and onexit events ? thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 28, 2021 Share Posted September 28, 2021 6 minutes ago, Roberto Nicchi said: the implementation of onenter and onexit events Hello, What do you implying about these events? Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted September 28, 2021 Author Share Posted September 28, 2021 1 hour ago, Sherzod said: Hello, What do you implying about these events? I would like to execute some Delphi code when the focus enter the grid and when exit. In detail the code active (entering) and deactivate (exiting) some components ... The events are present in the Tunidbgrid class but are not executed. I remeber there was some problem in unigui (probably related to the Sencha framework ?) and so was impossible to detect the focus entering/exiting the grid. Maybe the grid enhancements have/will remove this problem. thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 29, 2021 Share Posted September 29, 2021 17 hours ago, Roberto Nicchi said: I would like to execute some Delphi code when the focus enter the grid and when exit. In detail the code active (entering) and deactivate (exiting) some components Hello, Try this approach for now. 1. procedure TMainForm.UniFormCreate(Sender: TObject); begin with UniDBGrid1.JSInterface do begin JSAddListener('focusenter', 'function(me){ajaxRequest(me, "focusenter", [])}'); JSAddListener('focusleave', 'function(me){ajaxRequest(me, "focusleave", [])}'); end; end; 2. procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = 'focusenter' then begin // end else if EventName = 'focusleave' then begin // end; end; We will try to add this in the next builds. Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted September 29, 2021 Author Share Posted September 29, 2021 5 hours ago, Sherzod said: Hello, Try this approach for now. 1. procedure TMainForm.UniFormCreate(Sender: TObject); begin with UniDBGrid1.JSInterface do begin JSAddListener('focusenter', 'function(me){ajaxRequest(me, "focusenter", [])}'); JSAddListener('focusleave', 'function(me){ajaxRequest(me, "focusleave", [])}'); end; end; 2. procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = 'focusenter' then begin // end else if EventName = 'focusleave' then begin // end; end; We will try to add this in the next builds. Thanks a lot. I'll try it. Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted September 29, 2021 Author Share Posted September 29, 2021 5 hours ago, Roberto Nicchi said: Thanks a lot. I'll try it. I have just tryed and it seems to work fine. Thanks a lot. Another thing that would be usefull (anyway i don't need it immediately) are two grid events that allows to detect when the focus exit (oncolumnexit) or enter (oncolumnenter) a grid column. Thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 29, 2021 Share Posted September 29, 2021 18 minutes ago, Roberto Nicchi said: are two grid events that allows to detect when the focus exit (oncolumnexit) or enter (oncolumnenter) a grid column. Can you please clarify? Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted September 29, 2021 Author Share Posted September 29, 2021 19 minutes ago, Sherzod said: Can you please clarify? OK, consider a grid with some columns. When the focused cell is in a specific column we want to activate a button in a tool bar that allows to perform some task. For example open a list where is possible to select some value for the cell. In the oncolumnenter event we could check if the focused cell is in that column and, if so, setup the tool button (enable it, maybe change the button icon, and set the onclick event with a specific procedure). In the oncolumnexit we will disable the button. thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 29, 2021 Share Posted September 29, 2021 13 minutes ago, Roberto Nicchi said: OK, consider a grid with some columns. When the focused cell is in a specific column we want to activate a button in a tool bar that allows to perform some task. For example open a list where is possible to select some value for the cell. In the oncolumnenter event we could check if the focused cell is in that column and, if so, setup the tool button (enable it, maybe change the button icon, and set the onclick event with a specific procedure). In the oncolumnexit we will disable the button. thanks. procedure TMainForm.UniDBGrid1SelectionChange(Sender: TObject); begin ShowMessage((Sender as TUniDBGrid).CurrCol.ToString) end; ? Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted September 30, 2021 Author Share Posted September 30, 2021 10 hours ago, Sherzod said: procedure TMainForm.UniDBGrid1SelectionChange(Sender: TObject); begin ShowMessage((Sender as TUniDBGrid).CurrCol.ToString) end; ? i'll try it. 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.