Custom edit template

Hi,

I have an example here of adding record to the tree grid.

https://stackblitz.com/edit/angular-vrtsl2-oubnsc?file=app.component.ts

What I need:

  1. After clicking "insert child" button, to have a focus inside a cell of the newly created row (string cell).
  2. After submitting value in an editable input field inside of the cell via key "Enter", to be able to see those changes in the treegrid.






1 Reply

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team November 22, 2021 04:31 PM UTC

Hi Michal, 

Thanks for contacting Syncfusion Support. 

Query#:-After clicking "insert child" button, to have a focus inside a cell of the newly created row (string cell). 
 
We have checked your query and we have achieved your requirement by using addRecord method with empty parameters with certain time interval. Refer to the code below:- 

App.Component.ts 
 
insert(data: any) { 
        var childRow = { 
            name: 'new Row', 
        }; 
        var treegrid = this.treegrid; 
        setTimeout(function () { 
            treegrid.addRecord(); // call addRecord method with data and index of parent record as parameters 
        }, 50); 
    } 
 
 
Please get back to us if you need any further assistance. 

Regards, 
Farveen sulthana T 


Loader.
Up arrow icon