Skip to Content

Sap.m.table while select checkbox particular field is to make editable false

Hi,

  I am using sap.m.table property having 7 fields. Last field i kept check box if i select that check box 6 and 7  input field should make as non editable field. I share the piece of code and image. please make correction.

In View.js:

   var oTemplate = new sap.m.ColumnListItem({

  cells : [

        

  new sap.m.Label({

                  text: "{Item}"

  }),mat,

  new sap.m.Label({

                  text: "{StockType}"

  }),

  new sap.m.Label({

                  text: "{SalesVal}"

  }),

  new sap.m.Input({

  value: "{EntryQnt}"

  }),

  new sap.m.Input({

  value: "{EntryUom}"

  }),

  new sap.m.Label({visible:false,

  value: "{Physinventory}"

  }),

  new sap.m.Label({visible:false,

  value: "{FiscalYear}"

  }),

  new sap.m.CheckBox({select:oController.zero})

  ]

  });

     oTable1.bindAggregation("items","/results",oTemplate);

     oTable1.setModel(oModel7);

In Controller.js:

zero:function(e){

  e.getSource().getItems().forEach(function(item) {

        e.getCells()[4].setEditable(!item.getSelected());

        e.getCells()[4].setValue("0.00");

      });

  

  },

SelctionBox.png (14.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jun 01, 2016 at 03:15 PM

    Hi Vinoth,

    Not sure, whether this is what you're expecting? JS Bin - Collaborative JavaScript Debugging

    Regards,

    Sai Vellanki.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 01, 2016 at 03:30 PM

    Vinoth,

    Instead of table cell indexing, I would suggest this way if you're using JSON: JS Bin - Collaborative JavaScript Debugging

    Since, the former code will break if cell index is changed in future.

    Regards,

    Sai Vellanki.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 02, 2016 at 05:21 AM

    Sai Vellanki  Thank you so much for your response this one i asked... 😊

    Add comment
    10|10000 characters needed characters exceeded