Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Can't get child to populate with SPCascadeDropdowns

$
0
0

For the life of me I can't get this working, and I'm sure it is something simple.

I'm using two lists that were previously being used by the SPCD.js and it work, but I'm looking to move to SPServices.

I have tried with jQuery 1.7.0 and 1.7.2 which are loaded up top with the master page and then below the edit and new forms I am adding the following as a CEWP.

The issue is that the parent filed seems to be working and is populated, but the child only has a (None) option and does not filter down properly at all. The child does have items that exist in multiple parents, ie parent items "Actual" and "Drill" both have their own "Fire" childs, one each.

 

<script language="javascript" type="text/javascript" src="/SiteAssets/JavaScript%20Librarys/SPServices/jquery.SPServices-0.7.1a.js"></script>

<script language="javascript" type="text/javascript">
  $(document).ready(function() {
    $().SPServices.SPCascadeDropdowns({
      relationshipList: "Incident Subcategory",
      relationshipListParentColumn: "IncidentType",
      relationshipListChildColumn: "Title",
      parentColumn: "Incident",
      childColumn: "Incident - Subcategory",
      //selectSingleOption: true,
      //matchOnId: true,
      //simpleChild: true,
      completefunc: function() {
          console.log("Cascade called")
      },
      debug: true
    });
  });
</script>

 

The parent list is named "Incident - Category" and a URL of "Incident%20%20Category"

This list has one column named "Incident" and a StaticName of "Title", not required and not enforced unique

The child list is named "Incident - Subcategory" and a URL of "Incident%20%20Subcategory"

There are two columns here, "Incident" (StaticName is "IncidentType") which is a lookup to the "Incident" filed in "Incident - Category", required and not enforced. 

The second column is "Incident - Subcategory" (StaticName is "Title") which is not required and not enforced.

 

In Chrome I receive the following when I put this all together:

POST http://server/departments/Security/internal/_vti_bin/Lists.asmx 500 (Internal Server Error) jquery-1.7.min.js:4
  f.support.ajax.f.ajaxTransport.send jquery-1.7.min.js:4
  f.extend.ajax jquery-1.7.min.js:4
  $.fn.SPServices jquery.SPServices-0.7.1a.js:1094
  (anonymous function) jquery.SPServices-0.7.1a.js:1380
  e.extend.each jquery-1.7.min.js:2
  e.fn.e.each jquery-1.7.min.js:2
  cascadeDropdown jquery.SPServices-0.7.1a.js:1315
  $.fn.SPServices.SPCascadeDropdowns jquery.SPServices-0.7.1a.js:1298
  (anonymous function) NewForm.aspx:1966
  f.Callbacks.n jquery-1.7.min.js:2
  f.Callbacks.o.fireWith jquery-1.7.min.js:2
  e.extend.ready jquery-1.7.min.js:2
  c.addEventListener.C jquery-1.7.min.js:2
Cascade called NewForm.aspx:1976

Does anyone know why this isn't working? Is it the non-unique values in the child?

Thanks,

David


Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>