I need to add new items to my Treelist field in the datasource item of the component from edit mode like Linklist. Anyway, Linklist contains child items but is there any way we can handle similar functionality for Treelist also.
If you are talking about this button on the Link List:
Than it's custom edit frame button which is located
/sitecore/content/Applications/WebEdit/Edit Frame Buttons/Link/Insert Sibling in the Core database. It's using
Sitecore.XA.Foundation.Editing.Commands.WebEditNew command. Take a look there into that class. Create new one, use the same, change what you want, have fun.