DataTable - compiling data from more JSONs, default view

  • I want to have a DataTable with data compiled from 2 JSONs (questions, answers). I have:
    The component:

         ref="table" >

    I load the datasets:

    import questions from '../data/questions.json'
    import answers from '../data/answers.json'
    import { QDataTable } from 'quasar'

    Then I export the component:

    export default {
        data: function () {
            data: [{}],
            columns: [],
            config: {
                leftStickyColumns: 1,
                noHeader: false,
                // other configuration
        mounted: function () {
            // first column:
                label: 'Question',
                field: 'question',
                width: '100px',
                type: 'string'
            // other columns
   => {
                    width: '15px',
                    type: 'string'
            // data from 2 files:
   => {
                var item = {}
                item.question = question.question
       => {
                    item[] = answer['votes'][]
        components: {

    And the problems:

    • No columns are shown at the load, I must select them manually in the Column Picker
    • Is it possible to show just some of the columns at load and leave the rest for the Column Picker?)
    • Is is possible to style the column name? (e.g., add picture/icon based on column name/description)

  • Admin

    All these will be possible in QDataTable revamp of future v0.15 (currently in the works).

Log in to reply

Looks like your connection to Quasar Framework was lost, please wait while we try to reconnect.