MDBTableEditor edit event not returning event data


Topic: MDBTableEditor edit event not returning event data

GrantPhillips pro premium priority asked 3 years ago

We have the following MDBTableEditor

<MDBTableEditor :dataset="dataset"
                                v-if="hasData"
                                v-model:edit="editMode"
                                hover
                                striped
                                pagination
                                fullPagination
                                confirm
                                sm
                                defaultValue=""
                                noFoundMessage="no data"
                                ref="editorRef"
                                @update="doAction('update', $event)"
                                @add="doAction('add', $event)"
                               @delete="doAction('delete', $event)"
                               @edit="doAction('edit', $event)"
                               @exit="doAction('exit', $event)"/>

with

const doAction = (action: string, event: any) => {
        console.log(action)

        if (action === "delete") {
            console.log("action ===" + action)
            const deletedID = event.row["id"]
        }

        if (action === "edit") {
            console.log("action === edit" + action)
            const rowId = event.row["id"]          
        }
    }

On a delete we get event data and can get the row, but for edit (and all other events) the event is undefined?

Why? Have we done something wrong?


Mikołaj Smoleński staff commented 3 years ago

Hello @GrantPhillips,

edit and exit events are only emitted when the whole table is switching the mode. Did you try to use an update event? It should contain new data.

Keep coding,  Mikołaj from MDB


GrantPhillips pro premium priority commented 3 years ago

Hi Mikolaj

Yes we have tried an update event but we dont receive an update event, all we get are edit followed by exit.


Mikołaj Smoleński staff commented 3 years ago

Ok then,

We'll check it and prepare a fix as soon as possible.

Keep coding,  Mikołaj from MDB


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Open

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Vue
  • MDB Version: MDB5 1.4.0
  • Device: pc
  • Browser: chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: No