MicroDroid/vue-materialize-datatable

Wrong data taken in table

danilopolani opened this issue · 6 comments

The table is getting wrong field from columns specs. Furthermore, perPage is not working. Table:

<datatable
        v-if="type == 'collapsed'"
        :columns="collapsed_columns"
        :rows="$parent.lines"
        :perPage="50"></datatable>

This is my columns array:

collapsed_columns: [
          {
            label: 'Method',
            field: 'method',
            html: true,
            width: '100px'
          },
          {
            label: 'URL',
            field: 'url',
            width: '30%'
          }
        ]

Rows:

[
  {
    date:"21/Jun/2017 06:36:18"
    last_agent:"\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36\""
    method:"<span class=\"tag is-info\">GET</span>"
    url:"/favicon.ico?_=517989746"
  }
]

And this is the (wrong) result. I'm using it with Single App Component inside Electron.

Example screenshot

@danilopolani The data is displayed correctly for me.

bildschirmfoto 2017-06-24 um 21 49 24

In your data example you are missing the , after each property within your row element - could you try fixing this? my node server will throw an error if i leave them, so i can not test it at the moment.

The missing comma is because it was the "dump" from Vue devtools, anyway in your screenshot the URL is in place of method...

facepalm will investigate this...

@danilopolani fixed in the next npm release.

bildschirmfoto 2017-06-25 um 13 19 16

@MicroDroid Could you please update the npm package, thanks.

Thank you, I'm waiting for the updated npm version :)

Updated.