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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Adding a row in which user will give input

Thread ID:

Created:

Updated:

Platform:

Replies:

144356 May 2,2019 11:20 AM UTC May 3,2019 05:17 AM UTC Angular - EJ 2 1
loading
Tags: Grid
Shounak
Asked On May 2, 2019 11:20 AM UTC

I want to get a new row on click of a button, in which user will give input in different colums as text box inputs, and after that the data source should be updated as the input the user gives.Kindly let me know how to implement this

Pavithra Subramaniyam [Syncfusion]
Replied On May 3, 2019 05:17 AM UTC

Hi Shounak, 
 
Thanks for contacting Syncfusion support. 
 
From your query,  We suspect that you want to programmatically add a new row in Grid and update it. If yes you can achieve your requirement by using the “addRecord” method and “endEdit” methods of Grid edit module. Please refer to the below code example, documentation link and sample link for more information. 
 
[component.html] 
<button (click)="add($event)" >Add</button>  // for adding a new row with input box 
       <button (click)="update($event)" >Update</button>  // updating the added row 
        <ejs-grid #grid id='Normalgrid' [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings' [toolbar]='toolbar'> 
            <e-columns> 
              .   .   . 
            </e-columns> 
        </ejs-grid> 
 
[component.ts] 
public add(e: any): void { 
        this.grid.editModule.addRecord(); 
    } 
public update(e: any): void { 
       this.grid.editModule.endEdit(); 
    } 
 
 
                               https://ej2.syncfusion.com/angular/documentation/api/grid/edit/#endedit 
 
Please get back to us if you need any further assistance on this. 
 
Regards, 
Pavithra S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon