andrewcourtice / vuetiful

Vuetiful is a component framework written on top of the Vue reactive library. It is primarily designed for creating business/administration applications where the displaying of data is paramount.
MIT License
488 stars 108 forks source link

Custom templates for cells are in the wrong order #32

Closed RIanDeLaCruz closed 7 years ago

RIanDeLaCruz commented 7 years ago
      <datatable
            v-if="isList"
            :source="rows"
            :striped="reversionTable.striped"
            :editable="reversionTable.editable"
            :groupable="reversionTable.groupable"
            :fixed="false"
            :line-numbers="reversionTable.numbering">
                <datatable-column id="sel" label="sel" width="3.25rem"
                    class="checkable-column" :sortable="false" :groupable="false">
                    <checkbox id="sel-all" v-model="selectAll"></checkbox>
                </datatable-column>
                <datatable-column
                    v-for="column in columns"
                    :key="column.label"
                    :id="column.field"
                    :label="column.label">
                </datatable-column>
                <datatable-column
                    id="actions"
                    label="Actions"
                    :sortable="false"
                    :groupable="false">
                </datatable-column>
                <template slot="sel" scope="cell">
                    <span>{{cell.value}}</span>
                </template>
                <template slot="actions" scope="cell">
                    <div>
                      <a @click="toItem(cell)" style="padding-left:0.83em">Edit</a>
                      <a @click="save(cell)" style="padding-left:0.83em">Save</a>
                    </div>
                </template>
        </datatable>

Given the snippet above, column headers are in the correct order but the associated cell in the rows are not.

It shows up as

# checkbox data1 data2 action
1 checkbox action data1 data2
RIanDeLaCruz commented 7 years ago

Closing this.

But for anyone who will see this, it was because the data was being brought in via AJAX, which messes up the order