refresh data in table

how can refresh the table when adding new data?


2 Replies

UD UdhayaKumar Duraisamy Syncfusion Team June 27, 2022 05:49 PM UTC

Hi Oasis,


We are validating the requirement. We will update the further details in two business days(29th June 2022).


Regards,

Udhaya Kumar D



UD UdhayaKumar Duraisamy Syncfusion Team June 28, 2022 03:06 PM UTC

Hi Oasis,


We have created a sample for adding the custom values to the popup and shared the sample link below for reference. In the below code snippet, when the custom value is entered, by using a button click even the custom value is added to the popup.


[app.component.html]

<ejs-autocomplete id='games' #sample [dataSource]='sportsData' [(value)]='value'

                [placeholder]='waterMark' [fields]='fields' (change)='onChange($event)'>

                <ng-template #noRecordsTemplate>

                <div id="nodata"> No matched item, do you want to add it as new item in list?</div> <button (click)="addNewItem($event)" class="e-control e-btn">Add New Item</button>

            </ng-template></ejs-autocomplete>

        </div>

 


[app.component.ts]

public addNewItem = () => {

    let customValuestring = (

      this.AutoCompleteObj.element.getElementsByClassName(

        'e-input'

      )[0as HTMLInputElement

    ).value;

    let newItem: { [keystring]: Object } = {

      Id: customValue,

      Game: customValue,

    };

    (this.AutoCompleteObj.dataSource as Object[]).push(newItem);

    this.AutoCompleteObj.hidePopup();

    this.AutoCompleteObj.addItem(newItem);

    this.AutoCompleteObj.value = customValue;

  };


Sample: https://stackblitz.com/edit/angular-cbpp7q?file=app.component.html,app.component.ts


Kindly try the above sample and let us know if this meets your requirement.


Regards,

Udhaya Kumar D


Loader.
Up arrow icon