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

Set initial window position with AngularJS

4 Answers 323 Views
Window
This is a migrated thread and some comments may be shown as answers.
Chai
Top achievements
Rank 1
Chai asked on 09 Sep 2014, 05:49 PM
I have a problem setting the initial window position.  Here's my markup. 

<span>
    <img id="helpIcon" src="../../../Content/images/q-mark-green-sm.png" class="{{ iconclass }}" ng-click="helpWindow.open()" alt="Help"/>
    <span id="helpWindow" class="{{dialogclass}}" kendo-window="helpWindow" k-position-left="400" k-position-top="20"
          k-title="'{{ helptitle }}'" k-on-open="helpWindowvisible = true" k-on-close="helpWindowvisible = false" style="display: none">
        {{ helptext }}
    </span>
</span>

Any help would be appreciated.

Thanks,
Chai

4 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 10 Sep 2014, 08:01 AM
Hello Chai,

The proper syntax is k-position="{ top: 100, left: 300 }". Here is a Dojo snippet that shows it.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Greg
Top achievements
Rank 1
answered on 18 Aug 2016, 01:56 AM

Is the following syntax supported?

{ top: auto, left: auto, bottom: 20, right: 20 }

It doesn't appear to work.  How would you do this?

0
Alex Gyoshev
Telerik team
answered on 19 Aug 2016, 07:11 AM

Hello Greg,

I am afraid that this format is not supported, as the window uses absolute positioning and the value 'auto' does not work in that case. To make a window centered horizontally and spanning vertically, you need to calculate its size and position and set them accordingly.

Regards,
Alex Gyoshev
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Danilo
Top achievements
Rank 1
answered on 10 May 2017, 07:36 AM

Hi Alex.

This is working in angularjs.

<div kendo-window="kwCompare" k-title="'Test'" k-draggable="false" k-modal="false" k-resizable="false" k-auto-focus="true" k-visible="false" ng-cloak>

$scope.kwCompare.center().open();

And the same open command in JQuery.

$("#kwCompare").data("kendoWindow").center().open();

Regards, Danilo

 

Tags
Window
Asked by
Chai
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Greg
Top achievements
Rank 1
Danilo
Top achievements
Rank 1
Share this question
or