SharePoint Pagination – Next 30 items


SCENARIO:

When there are more than 30 items(say, 50 or 100) in SharePoint list or library, it is difficult for users to scroll down the page and select the next set of items through Paging control. To overcome this, some developers prefer to change the item limit to 50 or 100 in modify view page. What if the list contains more than 100 items (imagine 2000 items). In Such cases, we cannot set item limit to 2000 as it will affect the page load performance.

General Position of Paging
General Position of Paging


SOLUTION:

We can move the paging control to the top inorder to navigate to the next 30 items immediately rather than scrolling down the page. To do so, insert the script editor webpart before the list webpart and paste the below code in it

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function()
{
$("#bottomPagingCellWPQ2").insertBefore("table.ms-listviewtable")
});
</script>


RESULT:

Paging control is moved to the top of the list
Paging control is moved to the top of the list

 

We can also bring the paging control at top and bottom positions using the below script:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function()
{
$("#bottomPagingCellWPQ2").clone().insertBefore("table.ms-listviewtable")
});
</script>


RESULT:

Paging control at top and bottom of the list
Paging control at top and bottom of the list

If this post is helpful to you, Please rate the article and provide your valuable feedback.

Hiding SharePoint 2007 Menus and navigations


In this article, let us see how to hide SharePoint 2007 menus and navigations using CSS and give a look as normal site.

SharePoint 2007 Menus and Navigations:

sharepoint-2007-menus-and-navigations

Hiding Site Action menus:

<style>
.ms-siteaction
{
display:none;
}
</style>

Hiding global breadcrumb:

<style>
.ms-globalbreadcrumb
{
display:none;
}
.ms-globalTitleArea
{
padding-top:5px;
padding-bottom:5px;
}
</style>

Hiding only left side of global breadcrumb:

<style>
.ms-globalleft
{
display:none;
}
</style>

Hiding Search Scope:

<style>
.ms-sbscopes
{
display:none;
}
</style>

Hiding all search options:

<style>
.ms-sbtable-ex
{
display:none;
}
</style>

 

After hiding Site actions, global left breadcrumb and search scope

 

search-scope-breadcrumb-and-siteaction
After hiding global breadcrumb, site actions and search scope.

 

after-hiding-menus
After Hiding Site Actions, global breadcrumb and all search options

 

Hiding navigation path(breadcrumb) in list forms:

<style>
.ms-titlearea
{
display:none;
}
/*To adjust the height and padding of the Page Title after hiding bread crumb*/
.ms-areaseparator
{
height:auto;
padding: 7px 0px 4px 7px;
}
</style>

Before hiding:

with-titleare

After hiding:

after-hiding-titlearea

To hide them using script:

<script>
$(document).ready(function()
{
$(".ms-siteaction").css("display","none");
$(".ms-globalbreadcrumb").css("display","none");
$(".ms-sbtable-ex").css("display","none");
$(".ms-titlearea").css("display","none");
});
</script>

 

To hide for all except developers, you can create a SharePoint group for developers and use the above code as discussed  here

SharePoint Designer 2007 Workflow : Stopped


Hi Friends – This article is yet another issue that we faced in Workflow

Recently, we created SharePoint Designer 2007 workflow to send email to the requester and SharePoint group, “Admin”. When the requester created an item, the mail did not trigger and the workflow status was “Stopped”. When one of the person from “Admin” group navigated to the list and approved it, mail was triggered. We were breaking our heads for an hour by rolling back the changes as it was working initially. Finally we came to know that “Admin” group in email was the Problematic one.

PROBLEM:

When we create workflow to send email with SharePoint group as mail recipient, the workflow stops running.

SOLUTION:

  • Go to Site Actions->Site Settings->People and groups under Users and Permissions
  • Click on the SharePoint group(in our case, Admin) and go to Settings->Group Settings
  • Allow everyone to see the membership of the group by changing the group settings as shown below:

group-settings

PART 2 : Working in MOSS using SPServices


In this article, we will see how to set and get People Picker value using SPFindPeoplePicker.

Get value from the people Picker:


<script>

var ppl = $().SPServices.SPFindPeoplePicker({
peoplePickerDisplayName: "User", //Display Name of People Picker Field
checkNames: true
});
alert(ppl.currentValue);

</script>

Set value to the People Picker:

To set static value in  the People Picker:


<script>

$(document).ready(function()
{
$().SPServices.SPFindPeoplePicker({
peoplePickerDisplayName: "User",
valueToSet: "kamal",
checkNames: true
});
});

</script>

To set logged in user name to the People Picker:


<script>

$(document).ready(function()
{
var user= $().SPServices.SPGetCurrentUser();
$().SPServices.SPFindPeoplePicker({
peoplePickerDisplayName: "User",
valueToSet: user,
checkNames: true
});
});

</script>