express-admin
express-admin copied to clipboard
How to format data while showing OneToMany Relations
trafficstars
Hello:
How can we format the data which is in list or select in case of OneToMany relations with multiple columns.
For example if I have a column
{
"name": "productId",
"verbose": "productId",
"control": {
"select": true
},
"type": "int(11)",
"allowNull": true,
"defaultValue": null,
"listview": {
"show": true
},
"editview": {
"show": true
},
"oneToMany": {
"table": "product",
"pk": "productId",
"columns": [
"amount",
"code"
]
}
}
Here in the oneToMany, columns I want to show two columns, they are shown but without any formatting. Like I want to show Code (amount). How this can be done?
Thanks
There is no option for that. The only way would be to intercept the execution via hook and modify the values on your own. If it's something really simple you can modify it using jquery on the client as well.
When developing a hooks just set a breakpoint inside it (debugger) and then use node-inspector to visualize the data structure.