Dataview Dynamic building issue


I try to build a dataview. In side I put n elements. after I need to update the values of each of these n items.

  1. Here is the dataview construction (inside a form view) :
  2. Adding the items:
    for (i=0 , to n -1){
    item = {id:i,prop1:“xxx”, prop2:“yyy”};

3.To update value : I destroy the previous items :

  1. After I attach new items :
    for (i=0 , to n -1)
    item = {id:i,prop1:“xxx”, prop2:“yyy”};

And then the script is blocked.

I alse try to perse a parse operation instead of deleteding items. But without success.
What thing I should do to update/ remove/ create new items in the dataview.

Here is the dataview declaration (inside a form) :

var schedulesUI_ = { view:“form”, id:“schedulesTab_”,scroll:true, elements:[
{view:“toolbar”, type:“Subbar”, elements:[{view:“label”, label:""},{ view:“datepicker”, id: “datePickerSchedules”, label: ‘Date’, labelAlign: “left”, width: 220},{view:“label”, label:""}]},
{ view:“dataview”, container:“data_container”, id:“schedulesList”, select: false,
template:"#name# - #time#duration:#duration#
remaining time:#remainingTime#
// template:"#name# - #time#",
// templateLoading:“Loading…”,
height:40 ,width:169,

Thank you for your attention.
Have a nice day.

The problem is solved.
I test if id is already in the list, and then perform an update opration.
So the point is closed.