Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

how to use '_id' instead 'id' field in datatable actions #10

Open
drascom opened this issue Nov 22, 2020 · 1 comment
Open

how to use '_id' instead 'id' field in datatable actions #10

drascom opened this issue Nov 22, 2020 · 1 comment

Comments

@drascom
Copy link

drascom commented Nov 22, 2020

hi,
first of all thank you for this great template.
i add custom data provider and it is working well.
But my records id label is '_id' and default edit/delete action buttons not working with that label
(when i clicked show or edit buttton it is routing to the dashboard)
how can i tell your system to use '_id' instead 'id' ?

@kura1420
Copy link

if you using is mongoose, to model write this

Schema.set('toJSON', {
	virtuals: true,
	versionKey:false,
	transform: function (doc, ret) {   delete ret._id  }
})

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants