Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3212

Converting javascript table code to XML code

$
0
0

Hi experts,

 

I am developing a fiori application .

 

 

I have created table in UI5 application which is written in javascript and is working fine . I need to convert this javascript code in to XML code inorder to develope fiori application.

 

 

Can anyone help me to convert this to XML code .

 

 

I am sharing my UI5 javascript code here.

 

 

 

Code:

 

 

  var JsonModel;

 

  //Create an instance of the table control

  var oTable = new sap.ui.table.Table({

  //title: "Activity list / 2015 December",

  visibleRowCount: 15,

  firstVisibleRow: 15,

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

  navigationMode: sap.ui.table.NavigationMode.Paginator

 

 

  });

 

 

  //Define the columns and the control templates to be used

 

 

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

  label: new sap.ui.commons.Label({

  text: "Step No"

  }),

  template: new sap.ui.commons.TextField().bindProperty("value", "STEP_ID"),

  sortProperty: "STEP_ID",

  filterProperty: "STEP_ID",

  width: "100px"

  }));

 

 

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

  label: new sap.ui.commons.Label({

  text: "Description"

  }),

  template: new sap.ui.commons.TextField().bindProperty("value", "STEP_DESC"),

  sortProperty: "STEP_DESC",

  filterProperty: "STEP_DESC",

  width: "100px"

  }));

 

 

 

  //Create a model and bind the table rows to this model

  var oModel = new sap.ui.model.json.JSONModel();

  oModel.setData({

  modelData: JsonModel

  });

 

 

  var url = "/xx/yy/sssss/xxyyzz(xx=" + xx + ",yy=" + yy+

  ", +

  ")/xx/?$format=json";

 

  JsonModel = new sap.ui.model.json.JSONModel();

  JsonModel.loadData(url);

 

 

 

  //oTable.setModel(oModel);

  oTable.setModel(JsonModel);

  oTable.bindRows("/d/results");

 

 

 

Thanks,

Shilpa


Viewing all articles
Browse latest Browse all 3212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>