cancel
Showing results for 
Search instead for 
Did you mean: 

Double Click functionality to read context of row without selecting row of UI5 table

Former Member
0 Kudos

Hi Experts,

   I am trying to read context of row when user double click on particular row. I have tried following code.


  1. this.oTable = new sap.ui.table.Table("RESTAB", {           
    width : "100%",
    rowHeight : 22,
    selectionMode : sap.ui.table.SelectionMode.Single
    });

    this.oTable.attachBrowserEvent(
    'dblclick', this.getController().handle_ok, this.getController());

Here "handle_ok" is the function and it contain logic to read selected row from F4 help and copy to respective field.


This code is working fine only when user selected particular row and double click on that row. But if user double click on row directly without selecting row then it is not picking respective row. Could you please let me know, is there any event for this requirement. I am new to JavaScript so please provide sample code.

Best Regards,

Sasidhar V.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use selectionBehaviour property in your table

JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.table.SelectionBehavior

selectionBehavior: sap.ui.table.SelectionBehavior.Row

Former Member
0 Kudos

Thanks a lot Indrajith.


Now row is selecting when I click anywhere on row and after that double click functionality is working fine. But when I double click directly on row still it is not picking respective row. Please let me know, is there any solution for this requirement. My requirement is Row should picked up when user double click on respective row without selecting.


Best Regards,

Sasidhar V.

Answers (1)

Answers (1)

former_member182862
Active Contributor
0 Kudos

Hi Sasidhar

Is this what you are looking for?

JS Bin - Collaborative JavaScript Debugging

Thanks

-D