JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Data Grid › with batch:true how can access to data.fields in news rows
Tagged: datagrid batch edit
- This topic has 4 replies, 2 voices, and was last updated 3 years, 6 months ago by
admin.
-
AuthorPosts
-
February 8, 2021 at 4:37 pm #101452
chips
MemberHi,
with the property batch:true
how can access to data.fields in news rows?
the function getBatchEditChanges() return this:
<span class=”name-and-value”><span class=”name”>added</span>:[</span>
<span class=”name-and-value”> <span class=”object-value-object value”><span class=”object-properties-preview”>{<span class=”name”>id</span>: <span class=”object-value-undefined”>undefined</span>, <span class=”name”>data</span>: <span class=”object-value-string”>”54908271-03c9-a70c-8a21-e32e9d4f62b7″</span>},</span></span></span><span class=”name-and-value”> <span class=”object-value-object value”><span class=”object-properties-preview”>{<span class=”name”>id</span>: <span class=”object-value-undefined”>undefined</span>, <span class=”name”>data</span>: <span class=”object-value-string”>”0cc156df-4da0-c7af-4adf-2ca40c21ea74″</span>},..</span></span></span>
]
<span class=”name-and-value”><span class=”name”>deleted</span>: <span class=”object-value-array value”><span class=”object-properties-preview”>[]</span></span></span>
<span class=”name-and-value”><span class=”name”>updated</span>: <span class=”object-value-array value”><span class=”object-description”>(3) </span><span class=”object-properties-preview”>[<span class=”object-value-object”>{…}</span>, <span class=”object-value-object”>{…},…</span></span></span></span>
February 8, 2021 at 7:18 pm #101455chips
MemberSorry , the above message. 🙁
Hi,
with the property batch:true
how can access to data.fields in news rows?
the function getBatchEditChanges() return this:
{
added:[{id:undefined,data:”54908271-03c9-a70c-8a21-e32e9d4f62b7″},
{id:undefined,data:”0cc156df-4da0-c7af-4adf-2ca40c21ea74″},
..
],
deleted:[],
updated:[{…},{…},..]
}
how can you read the values of the fields in data object?February 9, 2021 at 7:32 am #101456admin
KeymasterHi chips,
If there are updates in cell values, they will be stored in the ‘updated’ array. It contains all changed cells information. Each value in that array is a cell object with id, dataField, oldValue and newValue properties.
Best regards,
Peter Stoev
Smart UI Team
https://www.htmlelements.com/February 9, 2021 at 10:17 am #101462chips
MemberHi admin,
the updated array is fine.
My Issue is about added array returned by getBatchEditChanges() :
{
added:[{id:undefined,data:”54908271-03c9-a70c-8a21-e32e9d4f62b7″},
{id:undefined,data:”0cc156df-4da0-c7af-4adf-2ca40c21ea74″},
..
],
deleted:[],
updated:[{…},{…},..]
added array have object {id:undefined,data:”54908271-03c9-a70c-8a21-e32e9d4f62b7″} .
I would like to know how to access the content of eg: data:”54908271-03c9-a70c-8a21-e32e9d4f62b7″ since as the added row is not yet saved it cannot be accessed by grid.rows
Best Regards
February 9, 2021 at 11:22 am #101463admin
KeymasterHi chips,
This is an empty row as far as I see. It does not have id or any data added to it. When you edit it, it will have different values.
Best regards,
Peter Stoev
Smart UI Team
https://www.htmlelements.com/ -
AuthorPosts
- You must be logged in to reply to this topic.