Button to Open Note in a New Window

What I’m trying to do

I’ve got a dv.table and want to add a button to each row that will open the corresponding file in a new obsidian window. (Ideally, I’d like to have the new window display the note in Reading view on the left and Edit view on the right - but that’s not essential.)

Things I have tried

I’ve got this working to where I can open a file, but it opens in Windows notepad, not inside Obsidian.

Can anyone help with a solution for this? Or point me to where I can find more info? I don’t know JavaScript, I’ve just been pulling this together from resources I find. I appreciate the help!

dv.table(["Name", "", ],
    dv.pages('"_inbox/Unprocessed Notes"').map(p => {
		const reviewNoteBtn = this.container.createEl('button', {"text": "Review"});
			reviewNoteBtn.onclick = () => {  app.workspace.getLeaf(true).openFile(p.file,0); }; 
		/*this opens the file in system text app (Windows notepad), not obsidian, 
and simulataneously opens a new blank tab inside obsidian. 
got this from:  https://forum.obsidian.md/t/looking-for-a-way-to-quickly-open-files-with-dates-in-their-names/55334/6 */

        return [

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.