Let's follow up this discussion at the Neptune Community

(this forum will be kept in read-only mode)

How to make the cells of a column editable when a button is clicked

Hi,


I have a requirement where a table is first displayed with 4 columns ( all the columns in display mode) but when a button is clicked I want the last column to be enabled.

How to achieve this?


Tusen Takk Ole Andre...The code works like a charm...:)

Hi Rahul,


you could use a sap.m.Input control with property: editable=false.


On your button press event:


oInput.setEditable(true);

 


Best regards

Christoph 

Hi Christoph,


Thanks for your reply.


However, the solution would not work as this is not a single field. These are individual cells of a column of a table that I want to enable/disable on a click of a button.


Regards,

RAhul.

Hi Rahul


If you are using a table, please also add a field you can bind to the enable property. When pressing the button to edit, update the model data and set enable to true. Use this example script to set a field named ENABLED to true:


 

$.each(modeltabCustomer.oData, function (i, data) {
    data.ENABLED = true;
});

modeltabCustomer.refresh();

 

the table is called tabCustomer and then you can work with the model object modeltabCustomer



Regards

Ole Andre


Login or Signup to post a comment