File tree Expand file tree Collapse file tree 3 files changed +10
-16
lines changed
Expand file tree Collapse file tree 3 files changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -87,12 +87,10 @@ export class IgGridBase<Model> extends IgControlBase<Model> implements AfterCont
8787 }
8888 //check for changes in collection
8989 this . _changes = this . _differ . diff ( this . _config . dataSource ) ;
90- if ( this . _config . dataSource . length !== this . _dataSource . length ) {
90+ if ( this . _changes ) {
9191 this . _dataSource = jQuery . extend ( true , [ ] , this . _config . dataSource ) ;
92- if ( this . _changes ) {
93- this . _changes . forEachAddedItem ( r => this . addRow ( r . item , r . currentIndex ) ) ;
94- this . _changes . forEachRemovedItem ( r => this . deleteRow ( r . item [ pkKey ] ) )
95- }
92+ this . _changes . forEachAddedItem ( r => this . addRow ( r . item , r . currentIndex ) ) ;
93+ this . _changes . forEachRemovedItem ( r => this . deleteRow ( r . item [ pkKey ] ) ) ;
9694 }
9795 //check for changes in values
9896 if ( ! this . equalsDiff ( this . _config . dataSource , this . _dataSource , diff ) ) {
Original file line number Diff line number Diff line change @@ -37,12 +37,10 @@ export class IgHierarchicalGridComponent extends IgGridBase<IgHierarchicalGrid>
3737
3838 //check for changes in collection
3939 this . _changes = this . _differ . diff ( this . _config . dataSource ) ;
40- if ( this . _config . dataSource . length !== this . _dataSource . length ) {
40+ if ( this . _changes ) {
4141 this . _dataSource = jQuery . extend ( true , [ ] , this . _config . dataSource ) ;
42- if ( this . _changes ) {
43- this . _changes . forEachAddedItem ( r => this . addRow ( r . item , r . currentIndex ) ) ;
44- this . _changes . forEachRemovedItem ( r => this . deleteRow ( r . item [ pkKey ] ) )
45- }
42+ this . _changes . forEachAddedItem ( r => this . addRow ( r . item , r . currentIndex ) ) ;
43+ this . _changes . forEachRemovedItem ( r => this . deleteRow ( r . item [ pkKey ] ) ) ;
4644 }
4745 //check for changes in data source values
4846 if ( ! this . equalsDiff ( this . _config . dataSource , this . _dataSource , diff ) ) {
Original file line number Diff line number Diff line change @@ -39,12 +39,10 @@ export class IgTreeGridComponent extends IgGridBase<IgTreeGrid> {
3939
4040 //check for changes in collection
4141 this . _changes = this . _differ . diff ( this . _config . dataSource ) ;
42- if ( this . _config . dataSource . length !== this . _dataSource . length ) {
43- this . _dataSource = jQuery . extend ( true , [ ] , this . _config . dataSource ) ;
44- if ( this . _changes ) {
45- this . _changes . forEachAddedItem ( r => this . addRow ( r . item , r . currentIndex ) ) ;
46- this . _changes . forEachRemovedItem ( r => this . deleteRow ( r . item [ pkKey ] ) )
47- }
42+ if ( this . _changes ) {
43+ this . _dataSource = jQuery . extend ( true , [ ] , this . _config . dataSource ) ;
44+ this . _changes . forEachAddedItem ( r => this . addRow ( r . item , r . currentIndex ) ) ;
45+ this . _changes . forEachRemovedItem ( r => this . deleteRow ( r . item [ pkKey ] ) ) ;
4846 }
4947 //check for changes in values
5048 if ( ! this . equalsDiff ( this . _config . dataSource , this . _dataSource , diff ) ) {
You can’t perform that action at this time.
0 commit comments