Author Topic: how to add new row with child grid  (Read 1286 times)

cosconit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 11
    • View Profile
how to add new row with child grid
« on: October 14, 2020, 01:53:56 pm »
Hi, I have a nested detail grid that can display the main grid data and the child grid data, but I will not add a new row with the child grid data,initialize the child grid data。

My data are as follows
"groupDtls" is the child grid data
Code: [Select]
{
"uuid": "8bd15218481c48fc895410a2eb7ef4b0",
"dipCgoGrpUuid": null,
"cgoGrpCnnme": null,
"isLimChanged": 0,
"groupDtls": [
{
"recVer": 5,
"svcLoopAbbrv": "IC2",
"dirBound": "S",
"polCde": "PJN",
},{
"recVer": 5,
"svcLoopAbbrv": "IC9",
"dirBound": "N",
"polCde": "NAS",
},

]
}

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: how to add new row with child grid
« Reply #1 on: October 14, 2020, 05:04:14 pm »
Before initialization of nested grid, new row in nested grid can be directly added in groupDtls

Aftere initialization of nested grid, new row in nested grid can be added with addRow method.

https://paramquery.com/pro/api#method-addRow

Code: [Select]
grid.addRow(
    { newRow: {field: value,... } }
);

where grid is instance of detail grid.