troubleshooting Question

Hide a column

Avatar of Isaac
IsaacFlag for United States of America asked on
Microsoft SharePointjQuery
8 Comments2 Solutions405 ViewsLast Modified:
I would like to hide a whole list column called "Metric" if the current user is not part of a group called "ACC".  If he is a part of the group, I want to unhide he "Category" column.

The platform is SharePoint 2007.

<script type="text/javascript" language="javascript" src="http://vm1:35714/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" language="javascript" src="http://vm1:35714/js/jquery.SPServices-0.7.2.min.js"></script>

<script type="text/javascript" language="javascript">
  $(document).ready(function() {
var curUser = $().SPServices.SPGetCurrentUser();
alert(curUser);
    alert("jQuery");
   alert($().SPServices.SPGetCurrentSite());
 $().SPServices({
      operation: "GetGroupCollectionFromUser",
      userLoginName: $().SPServices.SPGetCurrentUser(),
      async: false,
      completefunc: function(xData, Status) {
        if($(xData.responseXML).find("Group[Name='ACC']").length == 0) {
          alert("Hide Metric Column!!");

        }
else
{
   alert("Unhide Category column")
}
      }
   }); /*close().SPServices({ */

  });
</script>

Any help would be much appreciated.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros