cancel
Showing results for 
Search instead for 
Did you mean: 

Handle the cellclick event in ui5 table

Former Member
0 Kudos

Hi Experts,

I got the requirement,  to display  the purchase order headers list in  table , select the particular cell i need to navigate the another table and display the item data in next view.For these using the cell Click method and i am getting the data in the below mentioned format how can i get the data using  javascript methods.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

your cellClick function should look like this:


var oTable = new sap.ui.table.Table({

  cellClick: function(oEvent) {

  oController.getTaskDetail(oEvent)

  }

});

In your controller:


getTaskDetail: function(oEvent) {

  var context = oEvent.getParameters().rowBindingContext;

  yourModel.setData(context.getObject());

  yourNewPage.setModel(yourModel);

}

context.getObject() contains the data of the cell you clicked on

Answers (1)

Answers (1)

jamie_cawley
Advisor
Advisor

You could use

cellClick: function(evt){

evt.getParameters().rowBindingContext.getPath();

}

to get the row binding and then bind this to your other view.

Regards,

Jamie

SAP - Technology RIG

Former Member
0 Kudos

Hi jamie,

Thanks for your response issue solved.