Can you help me to bind this function to WatcherTable object itself? Binding can be really mindblowing
WatcherTable.prototype.setRowData= function(rowData) {
var mockServer = new MockServer();
mockServer.init(rowData);
var viewportDatasource = new ViewportDatasource(mockServer);
this.table.api.setViewportDatasource(viewportDatasource);
setTimeout(function () {
this.table.api.sizeColumnsToFit();
}, 100);
};
I already tried to do like that:
WatcherTable.prototype.setRowData= function(function(rowData) {
var mockServer = new MockServer();
mockServer.init(rowData);
var viewportDatasource = new ViewportDatasource(mockServer);
this.table.api.setViewportDatasource(viewportDatasource);
setTimeout(function () {
this.table.api.sizeColumnsToFit();
}, 100);
}).bind(this);
But it is obviously not working (I think this code it doesn't make any sense).
How can I properly do this?
Thank you
setTimeoutthat you want to bind tothisthis.table.api.setViewportDatasource(viewportDatasource);