cancel
Showing results for 
Search instead for 
Did you mean: 

Editable table

Former Member
0 Kudos

I have this table

I bind odata service and get the firts row data. The folowing rows don't have more data. I want the rows 2,3,4 are editable as in the next image.

The table and the colums are editables in the code:

oTable= new sap.ui.table.Table("tableFechaRoja",{

                           visibleRowCount: 4,

                           width: '650px',

                           editable: true,

                           resizable: true,

                           flexible: true,

                          selectionMode: sap.ui.table.SelectionMode.Single,

                          selectionBehavior: sap.ui.table.SelectionBehavior.Row

               });

oTableFechaRoja.addColumn(new sap.ui.table.Column({label:new sap.ui.commons.Label({text: property.name,  editable: true,resizable: true, flexible: true}),

template: oControlFechaRoja,

sortProperty: property.name,

filterProperty: property.name,

editable: true,

resizable: true,

flexible: true,

enableColumnReordering:true,

width:'145px'

}));

}

else if(property.name == "DATE"){

  oTableFechaRoja.addColumn(new sap.ui.table.Column({

  label: property.name,

       template: new sap.ui.commons.DatePicker("dateColumn",{

           width:'140px',

        value: {

          path: "DATE",

    type: new sap.ui.model.type.Date({pattern: "dd/MM/yyyy"})

Accepted Solutions (1)

Accepted Solutions (1)

SergioG_TX
Active Contributor
0 Kudos

you need to make the template control editable. when you make the template control editable then your entire column get the same settings.



in the other hand, if you need rows and not columns, then you need to use a JSON object and set the editable property on each record in your array.

Answers (1)

Answers (1)

former_member207744
Contributor
0 Kudos

Hi,

In this example, I made editable column for 4th row, rest are readonly.

I'm not sure it will be helpful or not, to fit for your requirement give a try to change the logic.

JS Bin - Collaborative JavaScript Debugging</title> <link rel="alternate" type=&q...