Trying to figure out proper syntax to script navigation in Perspective. I've found the system.perspective.navigate function, just unsure of proper parameters.
Created a view for summary information for filters with parameter of FilterNum. Use flex repeater to display 20 filters and just assign FilterNum in flex repeater to update all. What would the proper syntax be to assign a click event script to the base "view" that would open up a Page "/Filter" while passing the parameter of FilterNum to the page?
Ignition doc example mentioned GatewayIP, port, etc which is a bit overwhelming. Developing system NOT on the final production environment. FYI, I an NOT any sort of coder, so this is a bit overwhelming.
Thanks as always for any suggestions!
Please don't omit verbs and sentence subjects (e.g., "I am trying to ..."). It makes it very difficult to read as each sentence appears to be a sub-clause with no main clause. Write for clarity and an international audience.
1 Like
So, system.perspective.navigate
takes a params
parameter, which should be a dictionary in which keys are the names of the parameters to pass to the view, and values are... values.
So, in your case, it will look something like this (I'm pulling the params declaration out of the function call to make things easier to read, and using a lot of newlines for the same reason):
params = {
'filterNum': 3
}
system.perspective.navigate(
page = "/Filter",
params = params
)
or, more concisely:
system.perspective.navigate("/Filter", params={'filterNum': 3})
3 Likes