Saturday, February 23, 2013

Change position of the “Add new announcement” link

This wasn’t a surprise when it was thrown at me with “Please do not spend much time researching, if you have not already done it in past.”.

The question from the stake-holders was “Does anyone know how to move the ‘add new item’ link at the bottom of lists to the top of the list? (it becomes hard to see and requires scrolling down when many items are added to a list).”

Since I had done that very recently, I came up with a quick solution for her as below:

image

The above highlighted link was moved to top as shown below:

image

This was easily achieved by placing some JQuery code within a hidden content editor on the page this was needed. Although this would move every “Add New…” links on that page, but my stake-holder had no issue with that. She wanted just that. Bingo !!!

Here’s is what you need to use:

<script language="javascript" type="text/javascript">
      $(document).ready(function () {
             $("td.ms-addnew").parent().parent().parent().each(function () {
             $(this).insertBefore($(this).prev());
      });
});

</script>