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

$telerik.getLocation() bug

5 Answers 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 04 Jul 2013, 01:36 PM
Hi, I notice that the $telerik.getLocation() returns wrong results. I am using it to get the position of an element on the page so I can put another element at the same position on the page over it. So I am using $telerik.getLocation() et $telerik.setLocation() but the returned location is few pixels less than the real position (as I remember is 4 pixels less in x and y).

When I run my application locally in Visual Studio 2012 using IE8, everything is fine but when I run it from an IIS located on server then like I said I am few pixels away (same browser). I found a workaround by using jquery instead to get the location with:

$telerik.$(element).offset().left; // .top

I still use $telerik.setLocation() to set the position which work.

PS: $telerik.getBounds() have the same problem with x and y.

5 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 09 Jul 2013, 03:19 PM
Hello Marc,

I have tried to reproduce the mentioned issue but to no avail. You can watch a short video with the test in the attached archive and then tell me what I am missing.

Could you please try to reproduce the unexpected behavior with the attached VS example and then tell us what changes you have made, so that we can proceed further with the investigation?

Could you also tell us what is the version of RadControls you are testing with? If it is not the latest official one (version 2013.2.611), does upgrading to it resolve the issue?

Regards,
Danail Vasilev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Marc
Top achievements
Rank 1
answered on 09 Jul 2013, 06:05 PM
Hi, I was using the version 2013.2.611.

I send a screenshot that shows the problem which is when I deploy the application on a server. As you will see, the behavior is little different depends on the browser. But even there, with the patch I suggest the behavior still the same if it run on IIS Express on from a server.

You will also notice that the function getLocation don't work as expected in Firefox when the page is scrolled.
0
Danail Vasilev
Telerik team
answered on 15 Jul 2013, 10:49 AM
Hi Marc,

The behavior you are having looks rather strange and it is not know to us. I have tried reproducing it with provided code from my previous post and the following IIS settings:
  • Using VS 2012 IIS Express.
  • IIS Version 7.5.7600.16385; Application Pool - ASP.NET 4.0, Pipeline Mode - Integrated, Identity - myUser
You can find a short video with the test in the attached archive if I am missing something.

Could you please provide us with the following information:
  • Did you make the test with the exact VS example that I have provided within the previous post or you have made some modifications to it, which may affect the proper functionality of getLocation function?
  • What is the version of .NET you are testing with?
  • Can you compare your IIS settings with the ones that I have provided above and then tell us what are the differences?
  • Can you compare the source codes of the rendered page by Cassini and IIS Express and tell us what are the differences? You can also send both source codes to us, so we can make an investigation further.
  • Can you compare whether the pages rendered by Cassini and IIS Express are in standard mode or in Quirks? I am asking about that because it may be possible that IIS Express for some reason is forcing Firefox in quirks, which in turn may affect the return value of the JavaScript function.

We look forward to receiving your replay.

Regards,
Danail Vasilev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Marc
Top achievements
Rank 1
answered on 15 Jul 2013, 06:37 PM
Hi, which player should I use to play your video?

I am using VS 2012 like you. But when I run it into another server, it is a Window Server 2012 with IIS 8.0.9200.16384.

To make my test I extract the javascript and the markup from your page and I put it on one of my exiting page which let me find another bug where getLocation don't work well on Firefox when the page is scrolled (or maybe it's setLocation, I can't say).

I am using .Net Framework 4.5.

We use same settings for IIS except the Identity is set to ApplicationPoolIdentity.

I don't know Cassini and to tell the truth I don't have the time to look for it because I am in a big rush, and also our IT guy is in vacation for few weeks...

But I can give you some hints...We already had other problems on how the pages were render locally vs on the server, and the problems were a lot bigger than few pixels! At that time we made changes on your pages to have a good look on both IIS. But later I was facing a problem where I should write special code depends on the IIS, which was not acceptable. So we investigate and we find that when IE run an application locally (intranet) then in show it in Compatible View mode and the invert when it's from the internet (see Tools | Compatibility View Settings menu in IE). To always have the same behavior we added the following line in our master page:

<meta http-equiv="X-UA-Compatible" content="IE=8" />

It works since my bug with getLocation. I thinks all of this may be related...
0
Danail Vasilev
Telerik team
answered on 18 Jul 2013, 12:03 PM
Hello Marc,

The video has been captured by Jing and is saved in .swf format, so that it can be played with every player that support this format (e.g. Irfan View).

Note that we support browsers listed in Browser Support help article only in their standards mode, which means the Compatibility View mode is not supported. That is why some issue like the mentioned one may arise in this mode.

What I can suggest you is to use the following meta tag, that disable the compatibility view:
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />

More information on the matter is available in this forum thread and this blog post.

If you are still encountering this issue I can suggest you send us a fully runnable sample that reproduces the issue, so that we can make an investigation locally.


Regards,
Danail Vasilev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
General Discussions
Asked by
Marc
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Marc
Top achievements
Rank 1
Share this question
or