Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
Navigating to Another Route in Same Extension via tecton.navigateTo

I'm trying to create a button that takes a user to another page in the same extension via tecton.navigateTo, but I can't seem to get it to work. I've looked at all the tecton documentation for navigateTo and don't see anything specific to routing within the same extension.

Example:

    actionButtons.forEach((element) => {
        // Add routing to action buttons
        let routeMap = {
            'action-a': 'a_route',
            'action-b': 'b_route',
            'action-c': 'c_route',
            'action-d': 'd_route'
        };

        element.addEventListener('click', (event) => {
            tecton.actions.navigateTo('ExtName', routeMap[event.target.id]);
        });
    });

And:

actionButtons.forEach((element) => {
		// Add routing to action buttons
		let routeMap = {
				'action-a': 'a_route',
				'action-b': 'b_route',
				'action-c': 'c_route',
				'action-d': 'd_route'
		};

		element.addEventListener('click', (event) => {
				tecton.actions.navigateTo('ExtName', {'routing_key': routeMap[event.target.id]});
		});
});

Each value in the routeMap array correlates to a method in my extension.py file. When I click on a button, nothing happens. No errors or anything. I know the event listener is firing because I can log a message when it's clicked.

I'm open to better or different ways to do this if there are any.

Votes Newest

Answers


Hello,

Any specific reason to use navigateTo over submitForm? You can use it like: submitForm("routing_key") see documentation here: https://docs.q2developer.com/guides/online_integration/forms.html

You can still use navigateTo() It would just be quite difficult. You would have to define an entry point for your piece of the code, and do something like: navigateTo(ExtName, entrypoint) It is just using a sledge hammer for a nail.

-Trey

Posted 3 years ago
Trey Teter
124 × 2 Administrator
0

This did the trick, thanks Trey!

— Brock Caldwell   3 years ago