Stemon63 Posted December 13, 2023 Share Posted December 13, 2023 Hi, I need to simulate doubleclick press for select a row in UniDbgrid, but from a UniButton, so I need help on the JS code to inject. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 13, 2023 Share Posted December 13, 2023 3 hours ago, Stemon63 said: I need to simulate doubleclick press for select a row in UniDbgrid, but from a UniButton, so I need help on the JS code to inject. Hello, What action happens in a double click in general? Quote Link to comment Share on other sites More sharing options...
Stemon63 Posted December 14, 2023 Author Share Posted December 14, 2023 HI, for "security" reasons (I don't know my users), I have inhibited the repeated calls to the server that occur when the user continuously scrolls through the records ("return false" in Mygrid.ClientEvents.ExtEvents.Values['selectionchange ']). When I double-click on the record, UNigui calls the server and synchronizes the current record so I can show the detail form. I need to perform the same operation from a UniButton. I need to call doubleclick event on the client from a Unibutton. Thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 14, 2023 Share Posted December 14, 2023 10 minutes ago, Stemon63 said: for "security" reasons (I don't know my users), I have inhibited the repeated calls to the server that occur when the user continuously scrolls through the records ("return false" in Mygrid.ClientEvents.ExtEvents.Values['selectionchange ']). Also this post may help you: Quote Link to comment Share on other sites More sharing options...
Stemon63 Posted December 14, 2023 Author Share Posted December 14, 2023 Hi Sherzod, thanks, I have already tested this solution. But that solution don't works for me for this scenario. It permits to call the server for every scroll (also non continuous). I want that dataset records on server are syncronized only with doubleclick. Ant this already works optimal because there are no calls on grid scroll, but server is updated on doubleclick.. I need simply a way for "force" pressing doubleclick on the grid from JS (called from a button or an action) 🙂 Thanks a lot Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 14, 2023 Share Posted December 14, 2023 Can you please provide your grid configuration? Quote Link to comment Share on other sites More sharing options...
Stemon63 Posted December 14, 2023 Author Share Posted December 14, 2023 Hi Sherzod, is a standard TUnidbGrid; object gridLista: TUniDBGrid Left = 16 Top = 16 Width = 761 Height = 307 Hint = '' ClientEvents.ExtEvents.Strings = ( 'selectionchange=function selectionchange(sender, selected, eOpts' + ')'#13#10'{'#13#10' return false;'#13#10'}') PagingBarAuxControl = lblTotRecord DataSource = D_Lista Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgRowSelect, dgConfirmDelete, dgAutoRefreshRow] ReadOnly = True LoadMask.Message = 'Caricamento Dati...' LayoutConfig.Region = 'center' BorderStyle = ubsFrameLowered TrackOver = False TabOrder = 1 PreventWrap = True Exporter.Enabled = True OnAjaxEvent = gridListaAjaxEvent OnColumnSort = gridListaColumnSort OnDblClick = gridListaDblClick OnClearFilters = gridListaClearFilters OnColumnFilter = gridListaColumnFilter Columns = < item FieldName = 'id' Title.Caption = 'ID' Width = 47 Sortable = True Menu.MenuEnabled = False Menu.ColumnHideable = False end item FieldName = 'com_comune' Title.Caption = 'Comune' Width = 304 Sortable = True Menu.MenuEnabled = False Menu.ColumnHideable = False end item Flex = 1 FieldName = 'com_prov' Title.Caption = 'Prov' Width = 67 Sortable = True Menu.MenuEnabled = False Menu.ColumnHideable = False end> end Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 16, 2023 Share Posted December 16, 2023 On 12/14/2023 at 2:26 PM, Stemon63 said: I have already tested this solution. But that solution don't works for me for this scenario. It permits to call the server for every scroll (also non continuous). Sorry, I doubt it, as you say. Could you make a simple testcase for this case? Quote Link to comment Share on other sites More sharing options...
Stemon63 Posted December 18, 2023 Author Share Posted December 18, 2023 I should send you a simple form with a button to a UniDbgrid... What I want to achieve is to double-click on the grid, not with the mouse, but through the code under the pressure of a button (or an action). So I get the server to synchronize again on the current grid record. No possible solution? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 18, 2023 Share Posted December 18, 2023 3 minutes ago, Stemon63 said: What I want to achieve is to double-click on the grid, not with the mouse, but through the code under the pressure of a button (or an action). So I get the server to synchronize again on the current grid record. No possible solution? Perhaps this won't work... Quote Link to comment Share on other sites More sharing options...
Stemon63 Posted December 18, 2023 Author Share Posted December 18, 2023 Or a javascript command that tells the server to synchronize the position of the current record in the dataset... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 18, 2023 Share Posted December 18, 2023 1 minute ago, Stemon63 said: Or a javascript command that tells the server to synchronize the position of the current record in the dataset... You can analyze the selectionchange event (params) and try using ajaxRequest. Quote Link to comment Share on other sites More sharing options...
Stemon63 Posted December 18, 2023 Author Share Posted December 18, 2023 So no way to simulate (or perform) a double click from a button (or any other action on the grid)? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 18, 2023 Share Posted December 18, 2023 19 minutes ago, Stemon63 said: So no way to simulate (or perform) a double click from a button (or any other action on the grid)? It is possible, but in your case, you suspend the selectionchange event, right? Quote Link to comment Share on other sites More sharing options...
Stemon63 Posted December 18, 2023 Author Share Posted December 18, 2023 Yes, Sherzod. (we could have users who work for the competition, who would continue endlessly scrolling the grids while holding down the up and down keys). I want to align the server only on single actions, and double click (or enter) already works perfectly. I just need the same key action from buttons (on mobile it is mandatory). But selectionchange must be disabled. I clearly need this to prevent users from crashing the system simply by holding down the arrow keys. Quote Link to comment Share on other sites More sharing options...
Stemon63 Posted December 20, 2023 Author Share Posted December 20, 2023 Hi Sherzod, any way for solve my traffic problem (which is useful to everyone)? This is all that's missing to be able to distribute my application 🙂 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.