SPCascade in Custom Form makes dropdown off center

Jul 12, 2012 at 3:19 PM

SPCascade in Custom Form makes dropdown off center. If I add IsDlg=1 in the URL it looks fine BUT I want to keep quick launch. Any idea what is going wrong?

Coordinator
Jul 12, 2012 at 4:11 PM

Hmm. I haven;t seen this. However, if you've customized the form, then the markup may be somewhat different than what the function is looking for. My guess is that you could fix it with CSS.

M.

Jul 31, 2012 at 8:48 AM

It works fine in Chrome. I have tried with an older version of SPServices and jQuery with same results. I have not done anything fancy with the form just made some other fields display instead of Edits.

Coordinator
Jul 31, 2012 at 12:45 PM

Can you post a link to a screenshot?

M.

Jul 31, 2012 at 12:55 PM

Here is a screen:

http://imgur.com/UYoFv

Coordinator
Jul 31, 2012 at 4:09 PM

Huh. I have no idea. SPCascadeDropdowns doesn't actually change the markup for the display; only what values are available as options. You're seeing the difference beween how SharePoint renders dropdowns with 20+ options in IE versus other broswers, though.

M.

Aug 1, 2012 at 9:01 PM

Just wondering if you could post the javascript you're using to call into SPServices.  I ran into a similar problem and I can't recall how I fixed it.  I am hoping that seeing the javascript would jog my memory.

Aug 2, 2012 at 7:52 AM

<script type="text/javascript" src="path/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="path/jquery.SPServices-0.7.1a.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
    	$("span[Title='Rejected by Sales']").closest("tr").hide();

        $().SPServices.SPCascadeDropdowns({
            relationshipList: "Types",
            relationshipListParentColumn: "Departments",
            relationshipListChildColumn: "Title",
            parentColumn: "Department",
            childColumn: "Types"
        });
  });
</script>

Aug 2, 2012 at 4:30 PM

As Marc stated you appear to be working with a complex drop down.  Try the following js to change the drop down to "simple" and see if you still have the issue:

 

<script type="text/javascript" src="path/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="path/jquery.SPServices-0.7.1a.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
    	$("span[Title='Rejected by Sales']").closest("tr").hide();

        $().SPServices.SPCascadeDropdowns({
            relationshipList: "Types",
            relationshipListParentColumn: "Departments",
            relationshipListChildColumn: "Title",
            parentColumn: "Department",
            childColumn: "Types"
        });

        $().SPServices.SPComplexToSimpleDropdown({
            columnName: "Types"
        });
  });
</script>

Coordinator
Aug 3, 2012 at 3:08 AM

Actually, _JT_'s code won't work because it's in the wrong order.

        $().SPServices.SPCascadeDropdowns({
            relationshipList: "Types",
            relationshipListParentColumn: "Departments",
            relationshipListChildColumn: "Title",
            parentColumn: "Department",
            childColumn: "Types",
            simpleChild: true
        });

You can switch to a simple child dropdown by adding the simpleChild option to the SPCascadeDropdowns call per the docs.

M.

Aug 3, 2012 at 8:35 AM

Awesome. That fixed the "issue". Great support from both of you - much appreciated!