This is a migrated thread and some comments may be shown as answers.

MVVM change event bubbling functionality since release v2013.1.619

7 Answers 60 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 24 Jun 2013, 09:40 AM
Hi, since upgrading to version v2013.1.619 our application is no longer able to retrieve change information.

In our scenario we only bind to the top level model changed event i.e. viewData (see sample json below). This json can be nested to several layers. This Model is dynamic and can be nested to many levels.

We are only interested in knowing which members have changed.

Previous to this release, if the value property of  M53675 changed we would receive multiple change events at the top level model, one to signify that the rows property had changed and one for the value property of M53675.
Since this update we nolonger receive the event for the member change, just the rows property and there is no way of working out what caused the row change event.
The issues appears to be that when a change is bubbling up, the details of the change are lost when the passes through an ObservableArray.

We can modify our code to iterate through our model and attach a handler to the change event of each observable rows array but we would much prefer if there was an option to allow the modified property to bubble up.

Sample JSON

"viewData": {
  "name": "Contact (Insured)",
  "ID": "4123",
  "reference": null
  },
  "containers": {   
   "C12409": {
    "containerID": 12409,
    "containerType": 6,
    "containerName": "Container12409",
    "isVisible": true,
    "entityID": 419,
    "entityName": "Contact",    
    "rowCount": 1,
    "rows": [{
     "instanceInfo": {
      "entityID": 419,
      "instanceID": -1,
      "instanceStateMemberID": 2235
     },
     "columns": {
      "M53675": {
       "memberID": 53675,
       "name": "Contact Type",
       "value": 2,
       "description": "Organisation",
       "isDisabled": false,
       "isMandatory": true,
       "isValid": true,
       "isVisible": true,
       "isTargetMandatory": false,
       "isChangedThisUpdate": false
      },
      "M53674": {
       "memberID": 53674,
       "name": "Domicile Country",
       "value": null,
       "isDisabled": false,
       "isMandatory": true,
       "isValid": false,
       "isVisible": true,
       "isTargetMandatory": false,
       "isChangedThisUpdate": false
      },
      "M53673": {
       "memberID": 53673,
       "name": "Domicile State",
       "value": null,
       "isDisabled": true,
       "isMandatory": false,
       "isValid": true,
       "isVisible": true,
       "isTargetMandatory": false,
       "isChangedThisUpdate": false
      },
      "M113263": {
       "memberID": 113263,
       "name": "Language",
       "value": null,
       "isDisabled": false,
       "isMandatory": false,
       "isValid": true,
       "isVisible": true,
       "isTargetMandatory": false,
       "isChangedThisUpdate": false
      },
      "M72693": {
       "memberID": 72693,
       "name": "Contact Function",
       "value": 2,
       "code": "CO",
       "description": "Company",
       "isDisabled": false,
       "isMandatory": false,
       "isValid": true,
       "isVisible": true,
       "isTargetMandatory": false,
       "isChangedThisUpdate": false
      }
     },
     "isChangedThisUpdate": false
    }]
   },

7 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 24 Jun 2013, 11:18 AM
Hi Steve,

 Indeed we changed the behavior of the change event in order to fix a bug causing multiple change events to fire when it wasn't needed. We may have broken a few valid scenarios though. Could you please provide a short jsbin demo which shows what your scenario is? We need to reproduce the problem at our side so we can fix it or provide a workaround. 

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Steve
Top achievements
Rank 1
answered on 26 Jun 2013, 12:49 PM
Hi, I've put a JSBin here

This example uses build 2013.1.514 as 2013.1.619 does not appear to be available on cdn.
If you change the value of Name, you get one change event saying that name has changed.
If you change the value of M53675 then you get 6 events firing 3 saying that the field containers.C12409.rows has changed and 3 saying that containers.C12409.rows[0].columns.M53675.value has changed.

We have set a "global" handler to track any changes to the view model on the change event of the view model itself. In our production code we are only interested in fields which end in ".value".

Since 2013.1.619 we only get the event firing for the field containers.C12409.rows . So we know that the rows property has changed but cannot work out what it is under rows that has actually changed.

Sorry I can't show an example with 2013.1.619 but I have no external location to put the files.
0
Atanas Korchev
Telerik team
answered on 26 Jun 2013, 01:50 PM
Hello Steve,

 Thank you for providing this sample. I reproduced the problem ans fixed it. The fix should be available in the next internal build which is due by the end of the week.

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Steve
Top achievements
Rank 1
answered on 27 Jun 2013, 08:30 AM
Excellent. Thanks a lot and thanks for the quick response.
0
Steve
Top achievements
Rank 1
answered on 27 Jun 2013, 02:07 PM
Excellent. Thanks for that and thanks for the speedy reply.
0
Steve
Top achievements
Rank 1
answered on 03 Jul 2013, 09:28 AM
Hi, there doesn't appear to have been an internal build yet. Is it available?
0
Accepted
Atanas Korchev
Telerik team
answered on 03 Jul 2013, 11:26 AM
Hi Steve,

 We just uploaded a new internal build.

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
MVVM
Asked by
Steve
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Steve
Top achievements
Rank 1
Share this question
or