This is a migrated thread and some comments may be shown as answers.

[Solved] Close from window

1 Answer 142 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
OfficeHeart
Top achievements
Rank 1
OfficeHeart asked on 25 Feb 2011, 04:14 PM
Hi,

Im building a section selector in a window. The window is filled with an .aspx and a treeview.
When selecting a section from the treeview I want to callback the selected value and close the window. How can I achieve this?

This is now my code, but the close part doesn't work:

function onSelect(e) {
            var tv = $("#AjaxTreeView").data("tTreeView");
            var item = $(e.item);
            var val1 = tv.getItemValue(item);
            parent.fCallback(val1);
  
            var window = $(this).data('tWindow');
            window.close();
        }

Thanks in advance,
Koen

1 Answer, 1 is accepted

Sort by
0
Accepted
Hristo Germanov
Telerik team
answered on 25 Feb 2011, 04:39 PM
Hello martin,

Thank you for the contacting us.

The problem is in this line of code:

var window = $(this).data('tWindow');
In the scope of the "onSelect" event "this" is the TreeVIew component. You need to get the window by id:
var window = $('Window1').data('tWindow');


All the best,
Hristo Germanov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Window
Asked by
OfficeHeart
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Share this question
or