We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Grid refresh after changing default value

Hi,

I have the following select:

<select class="form-control" [(ngModel)]="defaultId">
<option *ngFor="let i of employeList" [ngValue]="i.id">{{ i.firstName }} {{ i.lastName }}</option>
</select>
And the following Grid:
<ej-grid
id="Grid"
[allowRowDragAndDrop]="true"
selectionType="multiple"
[dataSource]="gridData"
[editSettings]="editSettings"
(actionComplete)="actionComplete($event)"
...

>
<e-columns>
...
<e-column field="ownerId" headerText="Owner" width="50" [editType]="editTypeDropdown" [dataSource]="employeList" foreignKeyField="id" foreignKeyValue="text" [defaultValue]="defaultId"></e-column>
</e-columns>
</ej-grid>
And in editSettings I have selected batch editMode.
And always when I change defaultId with select, that cause grid refresh, which trash all unsaved changes. So is there any solution which dosen't cause grid refresh when changing defaultValue for e-column?

Regards,
Marko



3 Replies

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team September 18, 2017 12:55 PM UTC

Hi Marko, 

Thanks for contacting Syncfusion Support. 

We have checked your query and we are unable to reproduce your reported problem at our end. We suspected that without saving the entire batch Editing changes (i.e. without click on update icon on the Grid) after finished the individual cell changes on Grid, you are changing the value on the dropdownlist that causes the Grid to remove saved data. To resolve this error, You need to save the entire batch edit changes by clicking OK button on pop up shown while click on update icon. When we doesn’t save the entire batch changes it will not get update on the Grid which is the behavior for Batch editing . After that you can select the default value change on the dropdownlist. 

Please refer to the documentation link:- 


Please refer to the Video demo:- 


If we misunderstood your query, please get back to us with further details. 

Regards, 

Farveen sulthana T 



MA Marko September 19, 2017 09:08 PM UTC

Hi,

yes there has come to missunderstanding, but this is probably my fault. In your video you have changing other select than I was talking about. To my problem comes when you change select with binding defaultId ([(ngModel)]="defaultId").

I have prepared an example and attached it with my code and video in it.

In video I change owner select, but my desktop recorder didn't capture that very nice, so:


https://puu.sh/xDPO6/4d37121a3b.png

and I don't wantt to lose those unsaved changes if I only changing default value for one column.

Regards,

Marko


Attachment: angular2seeds_8ff5d5b3.rar


FS Farveen Sulthana Thameeztheen Basha Syncfusion Team September 20, 2017 04:27 PM UTC

Hi Marko, 

We have checked your code example and screenshot and we can reproduce your reported problem only when we change the dropdownList value without saving the entire batch changes in the Grid. In Batch editing, we have to update the entire Batch editing changes when we change the individual batch cell or else insert any record. The updated changes will get lost if you doesn’t the click the update icon which was the default behavior of the Grid. So we suggested you to update the batch changes before changing the value on the dropdownList. 

Please refer to the documentation link and Demo link for batch editing:- 



Please get back to us if you need any further assistance. 

Regards, 

Farveen sulthana T 


Loader.
Live Chat Icon For mobile
Up arrow icon