Topic: MDB Bootstrap Support
krivera free asked 5 years ago
When i declare columns , the DataTable component take all props from my object and print all object on the view, for example:
columns : [{
label:'Alias',
field:'alias',
sort:'asc',
}, {
label:'Nombre Completo',
field:'nombre',
sort:'asc'
}, {
label:'Correo',
field:'correo',
sort:'asc'
}]
Object:[{uid: "X84n7pd3xNURaVFWT66Ox1jCf102", correo: "administrador@admin.com.mx ", alias: "adm", nombre: "Administrador adm adm", telefono: "5555555555"}, {uid: "KWKZ9mLfIYVTuo9h7zq5WycMOQ83", correo: "adrian.perdomo@gnp.com.mx", alias: "Adrian", nombre: "Adrian Perdomo ", telefono: "5564848948945"}]
View:
Image from view
Add comment
Jakub Mandra staff answered 5 years ago
Hi,
Row fields has to be in correspondence with column fields in proper order.
So structure beneath will be displayed correctly:
columns : [{
label:'Alias',
field:'alias',
sort:'asc',
}, {
label:'Nombre Completo',
field:'nombre',
sort:'asc'
}, {
label:'Correo',
field:'correo',
sort:'asc'
}]
Object:[{
alias: "adm",
nombre: "Administrador adm adm",
correo: "administrador@admin.com.mx "
}, {
alias: "Adrian",
nombre: "Adrian Perdomo ",
correo: "adrian.perdomo@gnp.com.mx"
}]
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Answered
Specification of the issue
- ForumUser: Free
- Premium support: No
- Technology: MDB React
- MDB Version: 4.8.4
- Device: WEB
- Browser: any
- OS: any
- Provided sample code: Yes
- Provided link: Yes