Skip to Content
0
Feb 14, 2014 at 10:51 PM

How to bind a Factory function to a Table Column

1123 Views

Hi

I am trying to bind a factory function to a table column template, however the values (id & current row cell) are returned as undefined

dashTable.addColumn(new sap.ui.table.Column({
  label:new sap.ui.commons.TextView({text:"Error",design:"Bold"}),
  template: new sap.ui.commons.TextView().bindProperty("text", "error",function(sId,oContext){ 
  alert(sId);
  alert(oContext);
  alert(oContext.getProperty('error'));
  

// if(slValue){
// //alert(slValue);
// if(slValue ==='Error does not match'){
// //sap.ui.getCore().byId('idVinField').addCustomData(customData);
// //this.getParent().getCells()[4].setValueState('Error');
// sap.ui.getCore().byId('idVinField-col4-row0').setValueState('Error');
// }
// return slValue;

}).bindProperty('textAlign','Center'),
  sortProperty: "error",
  filterProperty: "error",
  //customData:customData
  //
  }));

dashTable.addColumn(new sap.ui.table.Column({
  label:new sap.ui.commons.TextView({text:"TIN",design:"Bold"}),
  //template: new sap.ui.commons.TextView().bindProperty("text", "vin"),
  template: new sap.ui.commons.TextField({id:'idTinField'}).bindValue('tin'),
  sortProperty: "tin",
  filterProperty: "tin"
  }));

I am trying to highlight a specific cell (TIN field) in the current row based on the value of the error field....

Thanks

Sandip