Topic: MDBTableEditor edit event not returning event data

GrantPhillips priority asked 2 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 2 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 priority commented 2 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 2 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

Opened

Specification of the issue

  • ForumUser: Priority
  • 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