Server Side Grid (Observable Async): How to Edit & show values in grid from external button & testbox value

Dear Sir,

Using Grid server side (Observable Async), On screen we have external button and textbox. We've to provide value and on button click, this value should show in a grid column that are checked.

Attachment: Email2_6f75e3e0.zip

1 Reply 1 reply marked as answer

RS Rajapandiyan Settu Syncfusion Team December 14, 2020 11:27 AM UTC

Hi Salik, 

Thanks for contacting Syncfusion support. 

Based on your requirement, you need to update the textbox value in the selected rows in the Grid. 

You can achieve your requirement by using updateRow method. Find the below code example and sample for more information.  


  btnclick(args) { 
// get the input value from textbox 
    var value = parseInt((document.getElementById("amtvalue") as any).value); 
// get the selected rows index 
    var index = this.grid.getSelectedRowIndexes(); 
// get the selected records 
    var records = this.grid.getSelectedRecords(); 
    for (var i = 0; i < index.length; i++) { 
// change the input value in selected record 
      records[i]["amount"] = value; 
// update the value in Grid 
      this.grid.updateRow(index[i], records[i]); 
    } 
  } 

In the external button click, we get the selected records in the Grid and update the amount value in the selected rows by using updateRow() method. 



Note: Editing feature requires a primary key column for CRUD operations. To define the primary key, set columns.isPrimaryKey to true in particular column. 

Please get back to us if you need further assistance with this. 

Regards, 
Rajapandiyan S

Marked as answer
Loader.
Up arrow icon