SPCascadeDropDown & SP 2010

Jun 15, 2010 at 7:46 PM

I've used SPCascadeDropDown on SP 2007 for a while now but I'm migrating to SP 2010.  Previously I inserted the code directly in the New and Edit page.  Following the same process I can't get it to work.  Where should this code be placed?

<!-- This section added for Cascading Dropdown Start  -->
<script language="javascript" type="text/javascript" src="/SiteAssets/Javascript/jquery.SPServices-0.5.5.js"></script>
<script language="javascript" type="text/javascript" src="/SiteAssets/Javascript/jquery.SPServices-0.5.5.min.js"></script>
<script language="javascript" type="text/javascript">
      $(document).ready(function() {
 $().SPServices.SPCascadeDropdowns({
                  relationshipList: "FundSubCategories",
                  relationshipListParentColumn: "FundCategory",
                  relationshipListChildColumn: "Title",
                  parentColumn: "Category",
                  childColumn: "SubCategory",
                  debug: true
            });
      });
 </script>
<!-- This section added for Cascading Dropdown End  -->

Coordinator
Jun 15, 2010 at 7:49 PM

You're referencing both the normal and minified versions of SPServices (you should only reference one), but you're not referencing the jQuery library itself.

M.

Jun 15, 2010 at 7:56 PM

Which is the apropriate file to download?

jquery-1.4.1.js 

Coordinator
Jun 15, 2010 at 7:59 PM

I'd recommend using the minified versions of both libraries, and jQuery-1.4.2.min.js is the most recent.

I spell out the dependencies in the documentation for SPServices, and as you upgrade to newer versions of SPServices, be sure to check those dependencies as well.

M.

Jun 15, 2010 at 9:38 PM

I'm at a loss.
From SP Designer 2010 i ctrl-click the source scripts it takes me to the right place so the scripts are pathed correctly. 

I've tried placing the code just within the <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">.

I've tried placing within the <ZoneTemplate>, and inside the <webpart>.

There has to be something I'm missing about using this with 2010. Is there a security setting or something?

<script language="javascript" type="text/javascript" src="/SiteAssets/Javascript/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="/SiteAssets/Javascript/jquery.SPServices-0.5.5.min.js"></script>
<script language="javascript" type="text/javascript">
      $(document).ready(function() {
  $().SPServices.SPCascadeDropdowns({
   relationshipList: "FundSubCategories",
   relationshipListParentColumn: "FundCategory",
   relationshipListChildColumn: "Title",
   parentColumn: "Category",
   childColumn: "SubCategory",
   debug: true
  });
      });
</script>

 

 

Jun 15, 2010 at 10:02 PM

Ok, My oversight.

When I renamed the NewForm to NewFormOriginal SP Designer 2010 adjusted the url to the new file name.  So when I went to add a new record I was directed to NewFormOriginal and not NewForm which was where I was making my edits.  I only cought it after inspecting the full url.

It's time for beer.

Thanks for your help

New Mexico

Coordinator
Jun 16, 2010 at 3:59 AM

Glad you worked it out!

I would suggest that you always leave the original form alone entirely and create a copy and rename it. In other words, rather than renaming the original NewFormOriginal, create a copy and call it NewFormCustom.

M.