Jump to content

UniDBgrid - how simulate doubleclick on a grid row (client code or JsCode) pressing a UniButton


Stemon63

Recommended Posts

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

Link to comment
Share on other sites

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:

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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
 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...