function(scContent) {
      if (_.isEmpty(scContent['data'])) {
        return;
      }
      let columns = [];
      if (scContent['columns']) {
        // already have columns
        columns = scContent['columns'];
      }
      else {
        // make columns headers from data
        let model = this._modelInfo(scContent['forModel']);
        _.forEach(_.head(scContent['data']), function(value, key) {
          if (!model.prop[key] || model.prop[key]['id']) {
            // no need to display Id column OR column not from model (programatic)
            return;
          }
          columns.push({ title: key.replace(model.ns, ''), data: key });
        });
      }
      return columns;
    }
function(scContent) {
      if (_.isEmpty(scContent['data'])) {
        return;
      }
      let columns = [];
      if (scContent['columns']) {
        
        columns = scContent['columns'];
      }
      else {
        
        let model = this._modelInfo(scContent['forModel']);
        _.forEach(_.head(scContent['data']), function(value, key) {
          if (!model.prop[key] || model.prop[key]['id']) {
            
            return;
          }
          columns.push({ title: key.replace(model.ns, ''), data: key });
        });
      }
      return columns;
    }
function ( scContent ) { if ( _ . isEmpty ( scContent [ 'data' ] ) ) { return ; } let columns = [ ] ; if ( scContent [ 'columns' ] ) { // already have columns columns = scContent [ 'columns' ] ; } else { // make columns headers from data let model = this . _modelInfo ( scContent [ 'forModel' ] ) ; _ . forEach ( _ . head ( scContent [ 'data' ] ) , function ( value , key ) { if ( ! model . prop [ key ] || model . prop [ key ] [ 'id' ] ) { // no need to display Id column OR column not from model (programatic) return ; } columns . push ( { title : key . replace ( model . ns , '' ) , data : key } ) ; } ) ; } return columns ; }
makes column from model for datatable Component
makes column from model for datatable Component