sap.designstudio.sdk.DataBuffer.subclass("com.sap.sample.jsondatasource.JsonDataSource", function() {
var that = this;
var _hasHeaderRow = false;
var _hasHeaderColumn = false;
var _csvfile;
this.init = function() {
this.defineDimensions([{
key: "cols",
text: "City",
"axis": "COLUMNS",
"axis_index": 0
}, {
key: "rows",
text: "Date",
"axis": "ROWS",
"axis_index": 0
}], {
key: "measures",
text: "Measures",
containsMeasures: true,
members: [{
"key": "measure",
"text": "Temprature",
"scalingFactor": 2,
"formatString": "0.00 EUR;-0.00 EUR"
}]
});
};
this.csvfile = function(value) {
if (value === undefined) {
return _csvfile;
} else {
_csvfile = value;
return this; **//why we using this here?**
}
};
this.hasHeaderRow = function(value) {
if (value === undefined) {
return _hasHeaderRow;
} else {
_hasHeaderRow = value;
return this; **//why we using this here?**
}
};
this.hasHeaderColumn = function(value) {
if (value === undefined) {
return _hasHeaderColumn;
} else {
_hasHeaderColumn = value;
return this; **//why we using this here?**
}
};
this.afterUpdate = function() {
//
}
});
I have a doubt on this getter and setter. why we are using this here? what's the purpose instead we can return value right? Please anybody explain clearly. I have updated the entire code. Any suggestion now?