activebiz
activebiz

Reputation: 6248

MVC generic popup

I am looking to create a generic popup which can be opened from anywhere in the application using a button. The idea is that this popup will have a tree and user will click on node and it will return selected node (or Id related to that node). to the page where this popup is been called from.

I have created the treeview popup but the problem is I am not sure how to make this popup return something to the calling page. The calling page is not going to be a view it could be any view.

Any idea?

Upvotes: 0

Views: 502

Answers (1)

Jason Kulatunga
Jason Kulatunga

Reputation: 5894

Using a javascript function, you can call a function on the popup's parent page using the opener variable.

on parent page call this:

opener.SelectedNode(popupSelectedNodeId);

Where SelectedNode is a function on all your parent pages, and popupSelectedNodeId is the node that is selected on your popup page.

Upvotes: 1

Related Questions