11/**
2- * ngHandsontable 0.10.0
2+ * ngHandsontable 0.11.1
33 *
44 * Copyright 2012-2015 Marcin Warpechowski
55 * Copyright 2015 Handsoncode sp. z o.o. <hello@handsontable.com>
66 * Licensed under the MIT license.
77 * https://github.com/handsontable/ngHandsontable
8- * Date: Fri Apr 08 2016 16:20:06 GMT+0200 (CEST)
8+ * Date: Fri May 20 2016 09:23:23 GMT+0200 (CEST)
99*/
1010
1111if ( document . all && ! document . addEventListener ) { // IE 8 and lower
@@ -133,7 +133,7 @@ Handsontable.hooks.add('afterContextMenuShow', function() {
133133
134134 container . className = this . containerClassName ;
135135
136- if ( ! container . id && htSettings . hotId ) {
136+ if ( htSettings . hotId ) {
137137 container . id = htSettings . hotId ;
138138 }
139139 element [ 0 ] . appendChild ( container ) ;
@@ -567,7 +567,6 @@ Handsontable.hooks.add('afterContextMenuShow', function() {
567567 } else {
568568 scope . hotInstance . loadData ( newValue ) ;
569569 scope . htSettings . data = newValue ;
570-
571570 }
572571 } else if ( newValue !== oldValue ) {
573572 scope . htSettings [ key ] = newValue ;
@@ -576,6 +575,19 @@ Handsontable.hooks.add('afterContextMenuShow', function() {
576575 } , [ 'datarows' , 'columns' , 'rowHeights' , 'colWidths' , 'rowHeaders' , 'colHeaders' ] . indexOf ( key ) >= 0 ) ;
577576 } ) ;
578577
578+ /**
579+ * Check for reference equality changes for datarows
580+ * TODO: must the remaining bindingsKeys need to be added also if their reference changes
581+ */
582+ scope . $watch ( 'datarows' , function ( newValue ) {
583+ if ( newValue === void 0 ) {
584+ return ;
585+ }
586+ if ( scope . hotInstance . getSettings ( ) . data !== newValue ) {
587+ scope . hotInstance . loadData ( newValue ) ;
588+ }
589+ } ) ;
590+
579591 /**
580592 * Check if data length has been changed
581593 */
0 commit comments