I am trying to generate dynamic form based on the following criteria
Here is the object
const data = {
"recievedData": {
"pan_number": "3213265",
"gender": "M",
"last_name": "45645",
"pan_status": "VALID",
"middle_name": "null",
"rece_pan_num": "435353",
"first_name": "464",
"sent_pan_num": "546546",
"pan_name": "some name",
"pan_holder_title": "null"
},
"questions": [],
"entityTable": [
{
"id": 1,
"table1": "pan_number",
"table2": "sent_pan_num,rece_pan_num,pan_status",
"table1_edit": "1",
"table2_edit": "0",
},
{
"id": 2,
"table1": "pan_name",
"table2": "first_name,middle_name,last_name",
"table1_edit": "1",
"table2_edit": "0",
},
{
"id": 3,
"table1": "gender",
"table2": "pan_holder_title",
"table1_edit": "1",
"table2_edit": "0",
}
]
}
What I have tried so far, I didn't post it here because it may create confusion with understanding of my requirements. Can someone please help me with this?
I am assuming you are after a working solution rather than a programming challenge. If so, consider existing solutions: https://github.com/ineffablep/react-schema-form
This particular library allows you to do exactly what you need and supports different types of inputs (which can get tricky). Given this is an option, your problem becomes much easier to tackle - you just need to convert one JSON into another.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.