PDA

View Full Version : Combobox and jQuery and IE - Dropdown Position Offset



dragontree
27 Apr 2007, 1:14 PM
I was trying to track down a bug in my code locally, but I've isolated it to jQuery and IE. A combobox appears to be offset by several pixels. The attached image is from:

Examples and Demos/Form and ComboBox/Dynamic Forms

The bug is also present in the current API examples...

jack.slocum
30 Apr 2007, 4:30 AM
Your will have to post this to the jquery dimensions plugin. It provides those coordinates when using jQuery.

jheid
8 May 2007, 11:30 PM
Is this the same as the serious bug when migrating from 1.0 to 1.0.1 with jquery?

Just open http://extjs.com/deploy/ext/examples/grid/edit-grid.html, select the jquery adapter and scroll down in the table. Now click on "Light"-column und you will have the same offset as the scroll offset.

Or have I missed another bug report?

JOERN

dragontree
9 May 2007, 4:33 AM
Is this the same as the serious bug when migrating from 1.0 to 1.0.1 with jquery?

Just open http://extjs.com/deploy/ext/examples/grid/edit-grid.html, select the jquery adapter and scroll down in the table. Now click on "Light"-column und you will have the same offset as the scroll offset.

Or have I missed another bug report?

JOERN

I can't duplicate the test case that you describe with IE6 and jQuery . We must be talking about different bugs..

jack.slocum
9 May 2007, 8:31 AM
Offsets are calculated differently based on the container of the element. Somewhere, the jQuery plugin is missing part of the calculation. To be honest, I am not sure what it is missing.

jheid
9 May 2007, 9:42 AM
Offsets are calculated differently based on the container of the element. Somewhere, the jQuery plugin is missing part of the calculation. To be honest, I am not sure what it is missing.

Yes, but the example (and my application) works perfectly with 1.0 and the problem occured with 1.0.1 (same jquery.js and dimensions.js).

Could you see the problem with the demo (I tested it with IE 7 and FF 2.0.x)?

jack.slocum
9 May 2007, 3:46 PM
Try adding this somewhere after Ext:


Ext.lib.Dom.getXY = function(){
var o = jQuery(el).offset();
return [o.left, o.top];
}

dragontree
9 May 2007, 7:38 PM
Try adding this somewhere after Ext:


Ext.lib.Dom.getXY = function(){
var o = jQuery(el).offset();
return [o.left, o.top];
}

IE error: 'el' is undefined

tryanDLS
10 May 2007, 9:18 AM
That should be


Ext.lib.Dom.getXY = function(el){
var o = jQuery(el).offset();
return [o.left, o.top];
}\

jheid
10 May 2007, 11:55 AM
Try adding this somewhere after Ext:


Ext.lib.Dom.getXY = function(el){
var o = jQuery(el).offset();
return [o.left, o.top];
}

Thanks, it works.

dragontree
10 May 2007, 1:43 PM
That should be


Ext.lib.Dom.getXY = function(el){
var o = jQuery(el).offset();
return [o.left, o.top];
}\


Using Ext 1.0.1a, I still have the same offset dropdown.. :(

tryanDLS
10 May 2007, 1:48 PM
How could it be in 1.0.1a when he just came up with a fix today?

dragontree
10 May 2007, 9:07 PM
How could it be in 1.0.1a when he just came up with a fix today?

It's not in 1.0.1a. I was stating my local test environment version of Ext...

jheid
12 May 2007, 6:59 AM
It's not in 1.0.1a. I was stating my local test environment version of Ext...

Do you still have the problem?
If you do, I will tell what I have done to solve it:

I'm using the latest JQuery.js and the dimension.js from 2007-04-19 (search for it in the forum if this is the only difference). The last lines in the "Ext.onReady (function () {" function are the lines Animal has posted. This works for me perfectly.

dragontree
12 May 2007, 7:46 AM
Yes, I still have the issue.

I'm also using the latest jQuery, but I couldn't find the dimension.js in any thread that you mentioned. Can you point me to the title of the thread?

jheid
12 May 2007, 9:46 AM
Hhm, I've downloaded it from here: http://jqueryjs.googlecode.com/svn/trunk/plugins/dimensions/

brandon.aaron
13 May 2007, 3:15 PM
You can also download dimensions from here: http://jquery.com/plugins/project/dimensions

I couldn't tell from this thread if there was actually a bug in Dimensions or not. Let me know if there is and I'll get it taken care of.

dragontree
14 May 2007, 5:51 AM
You can also download dimensions from here: http://jquery.com/plugins/project/dimensions

I couldn't tell from this thread if there was actually a bug in Dimensions or not. Let me know if there is and I'll get it taken care of.

I believe it's a bug with jQuery Dimensions plugin. Using the latest version of the plugin, extJs 1.0.1a and IE6, I still have the bug (as noted in the original post and image).

Take a look at the API examples with a dropdown:

http://www.extjs.com/deploy/ext/docs/index.html