EDIT GRID, edit-type="dropdownedit" get options from my backend

Hello guys, 

I try to find a solution in others posts but I did found nothing.
I'm using grid component for VUE, and I need to call my backend and ask the options of dropdown when I start to edit the row.
So:

1) double click to row

2) call my backend for receive the options of dropdowlist

3)give the options to dropdown components

I use axios to call the backend(giving token and other params). 
Some solution?


1 Reply

PS Pavithra Subramaniyam Syncfusion Team March 15, 2022 11:27 AM UTC

Hi Alberto, 
 
Thanks for contacting Syncfusion support. 
 
You can achieve your requirement by setting the DropDownList dataSource property inside the “actionComplete” event with request type as “beginEdit”. Please refer to the below code example and documentation link for more information. 
 
actionComplete: function (args) { 
  if (args.requestType === 'beginEdit') { 
    // here you can send your axios call and inside the then function you can set the dataSource 
    var dropDownList = args.row.querySelector('#' + this.grid.element.id + 'ShipCountry').ej2_instances[0]; 
    dropDownList.dataSource = []; 
    dropDownList.dataBind(); 
    dropDownList.refresh(); 
  } 
} 
 
 
 
Please get back to us if you need further assistance on this. 
 
Regards, 
Pavithra S 


Loader.
Up arrow icon