Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a page with multiple web parts.

Now I'm trying to move the "add new item" button on top of a webpart after the web part title.

I did this using jQuery, using the unique web part I want, but after the migration from 2007 into 2010 some of the web part ID changed.

So eg if the web part id is 5 in SP 2010, for some old pages it may be 6.

So I tried adding both 5 and 6, but then again this is not a solution as it moves the button on other web parts.

share|improve this question

1 Answer 1

using the id is generally a bad idea, specially if you have a common script for multiple pages

from what I see, you have three options

  • jack bauer: keep your script and fiddle around with your webparts (move them, close them, re enable them) hoping that at some point the ids will match what you need
  • nikita: embed a specific script on each page and use the ids for that page, instead of a global script (CEWP?)
  • sheldon cooper: create a proper script that looks for, perhaps .ms-wpheader and matches by titles of the webparts to do whatever
share|improve this answer
    
+1 for character answer –  Robert Lindgren Aug 4 at 18:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.