Skip to Content
avatar image
Former Member

How to make the row of a sap.ui.table selected while editing the value of a cell ?

Hi ,

I am developing sap UI5 application using sap.ui.table.Table.

return new sap.ui.table.Column({
  label: labelname,
  template: new sap.ui.commons.TextField({
  value: {
    path: columnName
  },
  editable: Editable,
  liveChange: function(oEvent) {
     var newUnitPrice = oEvent.getParameter("liveValue");
  }
 })
});

When i am changing the cell of the editable column , particular row has to be selected.

How to do that in javascript code ?

Thanks in Advance,

Sandeep
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 20, 2017 at 06:58 AM

    Hi all,

    I have achieved this using below code :

    liveChange: function(oEvent) {										
    	var rowindex = oEvent.getSource().getParent().getIndex();
    	that.oPriceProcedureTable.setSelectedIndex(rowindex);	
    }
    
    Add comment
    10|10000 characters needed characters exceeded

  • Feb 13, 2017 at 11:16 AM

    Introduce "selectionBehavior" property to your table as below:

    var oTable = new sap.ui.table.Table("idUiTable", {
        selectionBehavior: "Row"
    });

    while editing input value, particular table row will be selected.

    Thanks,

    Akhilesh

    Add comment
    10|10000 characters needed characters exceeded