Hi All,
I am having two set of odata response which I am retrieving through oModel.Read.
testarray[0] = oData;
testarray[1] = oData;
After this the the generated array of objects is converting to an object like this
var rg = {};
for (var i = 0; i < testarray.length; ++i)
{
rg[i] = testarray[i];
}
Setting a model:
var singleRowModel = new sap.ui.model.json.JSONModel({});
var oTable = new sap.ui.table.Table("oTable");
oTable.addColumn(new sap.ui.table.Column({label: new sap.ui.commons.Label({text: "Rate Category"}),template: new sap.ui.commons.TextView({text: "{RateCategory}"})}));
oTable.addColumn(new sap.ui.table.Column({label: new sap.ui.commons.Label({text: "Net Amount"}),template: new sap.ui.commons.TextView({text: "{NetAmount}"})}));
oTable.setModel(singleRowModel, "singleRowModel");
singleRowModel.setData(rg);
oTable.bindRows("singleRowModel");
Now i can see in the console the defined oTable is loaded with the singleRowModel with odata as two Objects which i got from the odata response earlier.
singleRowModel
F {mEventRegistry: Object, oData: Object, bDestroyed: false, aBindings: Array[0],mContexts: Object…}
- aBindings: Array[0]
- aPendingRequestHandles: Array[0]
- bCache: true
- bDestroyed: false
- bLegacySyntax: false
- iSizeLimit: 100
- mContexts: Object
- mEventRegistry: Object
- mSupportedBindingModes: Object
- oData: Object
- 0: Object
- DifferenceAmount: "0.00"
- GrossAmount: "618.03"
- NetAmount: "525.98"
- RateCategory: "GT_MWS"
- RateCategoryTxt: "Global temp metered and sewerage"
- Ratecat: "GT_MWS"
- SelRatecat: ""
- Simfrom: "2015-03-18T00:00:00"
- Simto: "2016-03-17T00:00:00"
- TaxAmount: "92.05"
- Vertrag: "50000267"
- Wears: "GBP"
- __metadata: Object
- __proto__: Object
- 1: Object
- DifferenceAmount: "70.68"
- GrossAmount: "688.71"
- NetAmount: "586.14"
- RateCategory: "NEWMET"
- RateCategoryTxt: "New metered"
- Ratecat: "GT_MWS"
- SelRatecat: "NEWMET"
- Simfrom: "2015-03-18T00:00:00"
- Simto: "2016-03-17T00:00:00"
- TaxAmount: "102.57"
- Vertrag: "50000267"
- Wears: "GBP"
- __metadata: Object
- __proto__: Object
- __proto__: Object
- sDefaultBindingMode: "TwoWay"
- __proto__: F
oTable
F {bAllowTextSelection: true, mEventRegistry: Object, sId: "oTable", mProperties: F, mAggregations: Object…}
- _aIdxCols2Cells: Array[2]
- _aVisibleColumns: Array[2]
- _bAccMode: true
- _bActionMode: false
- _bAllowColumnHeaderTextSelection: false
- _bCallUpdateTableCell: false
- _bForceVisibleColCalc: false
- _bInheritEditableToControls: false
- _bOnAfterRendering: false
- _bRtlMode: false
- _bSyncScrollLeft: false
- _bjQueryLess18: false
- _clicksRegistered: 0
- _doubleclickDelay: 300
- _iColMinWidth: 20
- _iLastFixedColIndex: -1
- _iOldScrollLeft: 0
- _iOldScrollRight: 0
- _iTimerDelay: 250
- _lastParent: div#__dialog0-scrollCont.sapMDialogScrollCont
- _lastParentHeight: 0
- _lastParentWidth: 0
- _oCalcColumnWidths: Array[0]
- _oColHdrItemNav: E.extend.constructor
- _oHSb: f
- _oItemNavigation: E.extend.constructor
- _oResBundle: B
- _oSelection: E.extend.constructor
- _oVSb: f
- _sBindingTimer: undefined
- _sColHdrPosTimer: 218
- _sOwnerId: undefined
- _sScrollBarTimer: 178
- aBeforeDelegates: Array[0]
- aDelegates: Array[2]
- bAllowTextSelection: true
- bOutput: true
- iSuppressInvalidate: 0
- mAggregations: Object
- mAssociations: Object
- mBindingInfos: Object
- mBindingParameters: null
- mBoundObjects: Object
- mEventRegistry: Object
- mMethods: Object
- mProperties: F
- oBindingContexts: Object
- oModels: Object
- singleRowModel: F
- aBindings: Array[0]
- aPendingRequestHandles: Array[0]
- bCache: true
- bDestroyed: false
- bLegacySyntax: false
- iSizeLimit: 100
- mContexts: Object
- mEventRegistry: Object
- mSupportedBindingModes: Object
- oData: Object
- 0: Object
- DifferenceAmount: "0.00"
- GrossAmount: "618.03"
- NetAmount: "525.98"
- RateCategory: "GT_MWS"
- RateCategoryTxt: "Global temp metered and sewerage"
- Ratecat: "GT_MWS"
- SelRatecat: ""
- Simfrom: "2015-03-18T00:00:00"
- Simto: "2016-03-17T00:00:00"
- TaxAmount: "92.05"
- Vertrag: "50000267"
- Wears: "GBP"
- __metadata: Object
- __proto__: Object
- 1: Object
- DifferenceAmount: "70.68"
- GrossAmount: "688.71"
- NetAmount: "586.14"
- RateCategory: "NEWMET"
- RateCategoryTxt: "New metered"
- Ratecat: "GT_MWS"
- SelRatecat: "NEWMET"
- Simfrom: "2015-03-18T00:00:00"
- Simto: "2016-03-17T00:00:00"
- TaxAmount: "102.57"
- Vertrag: "50000267"
- Wears: "GBP"
- __metadata: Object
- __proto__: Object
- __proto__: Object
- sDefaultBindingMode: "TwoWay"
- __proto__: F
- __proto__: Object
- oParent: F
- oPropagatedProperties: Object
- sBindingPath: null
- sId: "oTable"
- sParentAggregationName: "content"
- __proto__: F
But while displaying I am not getting empty table, Can anyone please help where is the issue?
Regards,
Arun
Add a comment