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

[Solved] Positioning Telerik window

7 Answers 318 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.
Abiy
Top achievements
Rank 1
Abiy asked on 12 Oct 2010, 11:16 PM
Hi Everybody,

I am using telerik window to replace the standard javascript alert and confirm boxes, I open the window from a javascript using the client API here is the code I use:

function confirmSubmit(message) {               
                if (!dialog) {
                    dialog = $.telerik.window.create({
                    title: "Title",
                        html: message,
                        modal: true,
                        resizable: false,
                        draggable: false,
                        visible: false
                    })
                    .data('tWindow');
                }
                $('div.telerikWindowMessage').empty().append(message);
                dialog.center().open();
            }

and it works just fine for me, but if the user scrolls all the way down to the page and perform something that open the window, then the window get open at the page center,  and you cannot see it unless you scroll up. Is there any way that I can center it relative to  the window rather than the page. Thank you in advance.

Abiy,

7 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 13 Oct 2010, 07:27 AM
Hi Abiy,

 We fixed a similar problem in the service pack. You can try upgrading to this version.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Abiy
Top achievements
Rank 1
answered on 13 Oct 2010, 04:15 PM
Hi Atanas,
 

I replaced my telerik window js file with the new service pack file but it does not help, I want the window to get displayed at the center of visitors view port instead of the page. Does it depend on anyother js file rather than telerik.window.min.js?

Thanks,
Abiy
0
Alex Gyoshev
Telerik team
answered on 14 Oct 2010, 01:11 PM
Hi Abiy,

Please find attached a sample project that demonstrates the fix. It uses the latest internal build (but the issue should be fixed in the service pack, too). Does it differ from your setup?

Greetings,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
murali
Top achievements
Rank 1
answered on 10 Nov 2010, 11:13 PM
Hello Everyone, I am having a similar question, how do I position the window relative to a text box,
like I have a search box, want to open the results in a window right below the text box when the window opens for the first time
and from then on maintain its default behavior, like if the user moves the window to a different position and closes the search results open the window in the last known position.

If I don't specify anything the window opens on the top left corner of the browser, how do I change this behavior.

Thank you,
mk
0
Alex Gyoshev
Telerik team
answered on 12 Nov 2010, 02:43 PM
Hi Murali,

You should set the desired window coordinates before opening it.

    var searchBox = $('#searchBox'),
        searchBoxOffset = searchBox.offset();

    $('.t-window').css({
        left: searchBoxOffset.left,
        top: searchBoxOffset.top + searchBox.height()
    }).data('tWindow').open();


Kind regards,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
murali
Top achievements
Rank 1
answered on 12 Nov 2010, 03:25 PM
Cool, Thanks Alex, that did the trick.

mm
0
Varsha
Top achievements
Rank 1
answered on 19 Mar 2012, 09:02 AM
Hi Alex,

I m facing the issue in ie7-8-9 - that is window does not get centered of the page.

Also window ajax content does not appear when i open it in chrome browser.

suggest a solution pls.

Tags
Window
Asked by
Abiy
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Abiy
Top achievements
Rank 1
Alex Gyoshev
Telerik team
murali
Top achievements
Rank 1
Varsha
Top achievements
Rank 1
Share this question
or