src/js/datasource.js
function(records,config) {
    
    //the hell is this doing here
    this.id = new Date();

    if ( records instanceof Array ) {
        this.records = records;
    } else {
        var dataField = records.data;
        var data = records.datasource;
        this.records =  data[dataField];
    }
    this.config = config;
    if ( this.config ) {
        this.propertyConfigMap = {};
        this.config.cols.forEach( col => {
            this.propertyConfigMap[col.property] = col;
        });
    }

    //indexRecords.call(this);
}
function(records,config) {
    
    //the hell is this doing here
    this.id = new Date();

    if ( records instanceof Array ) {
        this.records = records;
    } else {
        var dataField = records.data;
        var data = records.datasource;
        this.records =  data[dataField];
    }
    this.config = config;
    if ( this.config ) {
        this.propertyConfigMap = {};
        this.config.cols.forEach( col => {
            this.propertyConfigMap[col.property] = col;
        });
    }

    //indexRecords.call(this);
}
function ( records , config ) { //the hell is this doing here this . id = new Date ( ) ; if ( records instanceof Array ) { this . records = records ; } else { var dataField = records . data ; var data = records . datasource ; this . records = data [ dataField ] ; } this . config = config ; if ( this . config ) { this . propertyConfigMap = { } ; this . config . cols . forEach ( col => { this . propertyConfigMap [ col . property ] = col ; } ) ; } //indexRecords.call(this); }
Create a new datasource using records array as a backing dataset

@param records
@constructor
Create a new datasource using records array as a backing dataset