Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

ContextMenu disturbed in Treeview(webcontrol) webpart after applying

  Asked By: Amos    Date: Jan 01    Category: Sharepoint    Views: 1456

We have a problem of displaying our custom context menu position in
Treeview webcontrol webpart after applying the styles in WSS site.

We were facing problem of displaying context menu in treeview webpart.
but later after implementing our business logic to work context menu
with fixed height and width of webpart and without fixing height and
width of the webpart(Seperate seperate logic). All the senario the
context menu was working fine.
Now our client has applied some of the CSS files to Team site. Which
overrides the default sharepoint styles also. and our webpart got
disturbed in contextmenu senario Since they are applying height and
width for title of webpart, font size changes etc. our context menu
does not display in proper position.

Is there any way to capture the webpart id so that we can calculate
the offset parent and height and display the context menu in proper
position irrespective applying styles.

Some how we could able to apply new logic to run contextmenu as follows:
1. Find the treecontrol id as soon as mouse right clicks fired.
2. Iterate its offset parent till the html body reaches.
3. If the offset parent crosses the webpart zone, break the loop.
4. Find the offset position from top most line (body) till webpart
offset parent.
5. Find the offset Top in Treecontrol when the mouse is clicked.
6. Add the coordinates of this top with step 2 produced pixels/points.
7. Add this offset calculation to X and Y position.

But this will not work on SPS site and MySite.
Any clue to work in all the senario including SPS and WSS site with or
without overriding styles.



No Answers Found. Be the First, To Post Answer.