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