Assuming you want to open the tiddler in the default story river, try this:

let actions='<$navigator story="$:/StoryList" history="$:/HistoryList">
<$action-navigate $to="TiddlerNameHere"/>
</$navigator>
'
window.parent.$tw.rootWidget.invokeActionString(actions,this)

On Sunday, July 10, 2022 at 3:29:53 PM UTC+2 andrewg_oz wrote:

> Thanks for your suggestions. Unfortunately, I left out some important 
> details in my OP and so I'm still trying things.
>
> The Google Charts are generated in an iframe, which is where the selection 
> handler is. It means the handler is not in the context of the widget/macro, 
> so 'this' isn't meaningful.
>
> I can access 'window.parent.$tw' and I've seen code fragments that make it 
> look like I should be able to do the following:
>
> window.parent.$tw.rootWidget.dispatchEvent( { type:'tm-navigate', 
> navigateTo: 'Tiddler Name Here' } );
>
> Nothing happens.
>
> I've tried a couple of other event properties too: setting 'param' the 
> same as 'navigateTo', and setting 'navigateFromTitle' to the name of the 
> tiddler hosting the macro call. Nothing for those either. Not even error 
> messages in the console.
>
> Thanks again for your help. Hoping you or anyone else might have some new 
> ideas...
>
> On Sunday, 10 July 2022 at 2:13:06 am UTC+8 BJ wrote:
>
>> or maybe
>> this.dispatchEvent({type: "tm-navigate", navigateTo:tids[i]});
>>
>>
>> On Saturday, July 9, 2022 at 4:12:28 PM UTC+2 BJ wrote:
>>
>>> from within a widget/macro use
>>>
>>> this.caller.dispatchEvent({type: "tm-navigate", navigateTo:tids[i]});
>>>
>>> On Saturday, July 9, 2022 at 9:30:01 AM UTC+2 andrewg_oz wrote:
>>>
>>>> I've recently been experimenting with using Google Charts in 
>>>> TiddlyWiki. It's going quite well (see my other thread), but I can't work 
>>>> out how to open a tiddler in javascript (i.e. the Google Chart selection 
>>>> handler) without using window.location = '#' + tiddlerNameHere;
>>>>
>>>> That works, but sets the address bar and looks ugly. I'm sure there's a 
>>>> better way.
>>>>
>>>> Can anyone help?
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b24ebba0-68d5-46c4-b89d-2a83eb422201n%40googlegroups.com.

Reply via email to