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

Cell in edit mode and focusout.

Hello again,
i tried to work with cell content in editMode but without success.

We have this new requirement:
When you are in edit mode and enconter a kind of coulmn (in this case Cod.C / we use an array to mark special column) you should:
  1. Get the content of the column/ cell that it is going to be edited. (i.e. Cod.Col column and cell value 5)
  2.  Apply a function to resolve a value from that content. (i.e.let result = ()=>resolve(5))
  3. The result of that function, i should using setCellValue and change the column +1 putting as value the result of the function. (ie. setCell(Cod.Col+1, result)
  4. The grid has a primary key to make setCellValue work.
In the picture above i would like to apply a function to the value resolve(5) and from that value i would like to the cell Nomb..still remaining in edit mode.
My problem is how to detect which cell is editing the user, retrieve the columName to look in the array and how to set the columnName+1.
Best Regards,

1 Reply

BS Balaji Sekar Syncfusion Team October 25, 2019 12:22 PM UTC

Hi Giorgio, 

Thanks for contacting syncfusion support, 

We have validated your query and we are created a sample with bind the keypress event on specific input element(CustomerName) and we are able change another column(Freight) value in the edit mode using actionComplete event in requestType as beginEdit. Please refer the below code example and sample for more information. 

actionComplete (args) { 
        if (args.requestType == "beginEdit") { 
           var inputEle = args.form.querySelector("tbody").querySelector("input[name=CustomerName]"); 
//Bind the keypress event in the CustomerName input element while editing the Grid 
            inputEle.addEventListener("keypress", function (args) { 
                var tbody = args.target.closest("tbody"); 
                tbody.querySelector("input[name=Freight]").value = 12000000; // We have update a value in Freight column value  

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

Balaji Sekar. 

Live Chat Icon For mobile
Up arrow icon