vue-components/query-list/component.js
/**
     * Gives columnDefs for each query in `queries`.
     */
Gives columnDefs for each query in `queries`.
Gives columnDefs for each query in ` queries ` .
columnDefs() {
      return this.queryResults.map(qr => {
        if (qr?.records?.length > 0) {
          return Object.values(
            qr.records.reduce((byField, record) => {
              return Object.keys(record).reduce((byField, field) => {
                if (!(field in byField)) {
                  byField[field] = { field, maxWidth: 500, headerName: field };
                }
                if (Array.isArray(record[field])) {
                  byField[field] = {
                    cellRenderer(p) {
                      const data = p.data[field];
                      return data
                        && '<a href="https://google.com/" target="_blank">View&hellip;</a>';
                    }
                  };
                }
                return byField;
              }, byField);
            }, {})
          );
        }
      });
    }
columnDefs ( ) { return this . queryResults . map ( qr => { if ( qr ?. records ?. length > 0 ) { return Object . values ( qr . records . reduce ( ( byField , record ) => { return Object . keys ( record ) . reduce ( ( byField , field ) => { if ( ! ( field in byField ) ) { byField [ field ] = { field , maxWidth : 500 , headerName : field } ; } if ( Array . isArray ( record [ field ] ) ) { byField [ field ] = { cellRenderer ( p ) { const data = p . data [ field ] ; return data && '<a href="https://google.com/" target="_blank">View&hellip;</a>' ; } } ; } return byField ; } , byField ) ; } , { } ) ) ; } } ) ; }
Gives columnDefs for each query in `queries`.
Gives columnDefs for each query in ` queries ` .