Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIproblem while getting element position using dnn.dom.positioning.dimsproblem while getting element position using dnn.dom.positioning.dims
Previous
 
Next
New Post
1/14/2009 9:55 AM
 

Hello,

We are trying to add filter to GridView columns. For that we are showing in image (lets call it filterImg) in the column header. When user clicks on the filterImg, we are trying to show a text field (put inside a DIV tag, we call it filterDiv) just below the image. For the alignment of this DIV tag, we are using the dnn.dom.positioning.dims method to get the position details of the image. We were able to do it till the time the GridView was directly put on the page. When we added the GridView on AJAX Toolkit's Modal Popup, we started facing problem. The left and top values of the position returned by dims() are getting offset by the position of modal popup.
So, filterDiv.left equals to filterImg.left + modalPopup.left and filterDiv.top equals to filterImg.top + modalPopup.top

We explicitly subtracted modalPopup position from the filterDiv postion just before displaying it, but it still causes problems at few other places. I suspect that its related to http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/76/threadid/57061/scope/posts/Default.aspx, where people have mentioned that they face problem in displaying menu if its put inside a DIV tag. (PS: the modal popup is asp:panel which is eventually renderred as a DIV tag)

I tried to debug the JS code and I found that in dnn.dom.positioning.js there is a method called elementPos() which is responsible for calculating / finding the position of the element. There is 1 while loop that traverses up the DOM hierarchy (ele, parent, grandparent ... till BODY / HTML). And in each iteration its adding up the value of offsetTop to the return value, based on some conditions. The conditions are: "if (eSrc.style.position != 'absolute')" and "if (eParent.id == eSrc.id || eParent.style.position != 'relative')". I'm not clear what these condition do exactly and hence suspecting them to cause the trouble. :)

Has someone faced similar problem?
What is the solution?
Can someone explain me the logic of elementPos()?

Thanks & Regards
- Vivek Athalye

 

 
New Post
1/14/2009 2:14 PM
 

I can't comment on your issue or a possible resolution with the provided DNN positioning routines, but I generally have good luck with this platform-agnostic JS library (from Matt Kruse) for determining DOM element positions:

  http://javascripttoolbox.com/lib/objectposition/

It's fairly short and simple -- you might give it a quick spin and see if you have better results.

Good luck!
-mamlin


esmamlin atxgeek.me
 
New Post
1/14/2009 2:14 PM
 

(deleting this double-post)


esmamlin atxgeek.me
 
New Post
1/14/2009 9:27 PM
 

Since you are using the ajax toolkit you have the MSAJAX framework available to you.  I would try Microsoft's function for getting the bounds.  Please report back if that worked for you and if you have a sample url to view it may help me assist more.

Also, I know there was issues with some of the toolkits stuff if you did not use a certain DOCTYPE. 


 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIproblem while getting element position using dnn.dom.positioning.dimsproblem while getting element position using dnn.dom.positioning.dims


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out