'childColumnStatic' is undefined

Sep 18, 2012 at 11:49 AM

Hello,

I am getting 'childColumnStatic' is undefined when I use SpCascadeDropdowns on my custom solution.

I have deployed a custom parent content type with a lookup field called Region and a sub content type with some additional fields inheriting from this parent type on my custom list. When I place my cascade code on the custom form I get the error. If I go in and manually create another Region lookup field on my parent content type just like I do in code it will work fine.

If I replace the childColumn to something else the debug will pop open and tell me it doesn't exist which is true. If I go in and manually create another column in the same way I deploy programmatically it will work fine.

I am tearing my hair out trying to figure out what can be the issue. Am I missing something obvious?

$().SPServices.SPCascadeDropdowns({
  relationshipList: "Region",
  relationshipListParentColumn: "Brand",
  relationshipListChildColumn: "Title",
  parentColumn: "Brand",
  childColumn: "Region",
  debug: true
});
Thanks

Coordinator
Sep 18, 2012 at 12:41 PM

It's hard to say, given you have customized things.

Where are you seeing the "'childColumnStatic' is undefined" error? Can you debug to that line?

M.

Sep 18, 2012 at 12:43 PM

It is coming up in IE  error details. If I change the childColumn to something incorrect the SPServices debug window will come up.

 

  'childColumnStatic' is undefined  jquery.SPServices-0.7.1a.min.js, line 19 character 26678

var at={opt:ar,childSelect:i,childColumnStatic:childColumnStatic,childColumnRequired:childColumnRequired}

Coordinator
Sep 18, 2012 at 1:00 PM

I think it's having trouble getting information from the GetList results for the column. Can you inspect the results to see what the Region column looks like?

Also, if you could switch to the non-minified version of the librry, it would tell me exactly where in the code the error is occurring.

M.

Sep 18, 2012 at 1:11 PM

Dear Marc,

What do you mean with inspecting the results?

 

  'childColumnStatic' is undefined  jquery.SPServices-0.7.1a.min.js, line 19 character 26678  'childColumnStatic' is undefined  jquery.SPServices-0.7.1a.js, line 1246 character 3

// Save data about each child column on the parent
		var childColumn = {opt: opt, childSelect: childSelect, childColumnStatic: childColumnStatic, childColumnRequired: childColumnRequired};
		var childColumns = parentSelect.Obj.data("SPCascadeDropdownsChildColumns");

Coordinator
Sep 18, 2012 at 2:53 PM

I mean looking at the results from the GetList call. Is your custom page in the context of the list? i.e., stored at /Lists/Listname?

It looks like the call to GetList immediately above the code you show isn't returning the StaticName or it may be failing.

M.

Sep 18, 2012 at 3:55 PM

Dear Marc,

I was storing the custom page in /site/AppPages/CustomPage.aspx where I had all my custom pages. I moved the form to the Lists/Listname area and it now works fine :)

So this one should be flagged as a lessons learned I guess? 

Thanks for your guidance as always!

/David

Coordinator
Sep 18, 2012 at 4:02 PM

Note that you can pass the listName in as an option if you want to store your forms elsewhere. By default:

   listName: $().SPServices.SPListNameFromUrl(),  // The list the form is working with. This is useful if the form is not in the list context.

M.