SPCascadeDropdowns - Double-clicking required

Sep 15, 2010 at 5:36 AM

Hi,

First of all, I want to thank you for this library.  It has been very useful.

I have a Parent drop-down, "Process", and a Child drop-down "SubProcess".  Everthing works correctly, except that when I go to select an item from the "SubProcess" drop-down, nothing happens unless I double-click the item. 

I thought that this might be due the fact that it is a list of about 200 items in the "SubProcess" drop-down and that jQuery was processing in the background.  However, even when I wait a long time, I still have to double-click to select the item.

I also note that the prompt does not appear in the "Sub-Process" drop-down, which I also was attributing to the number of items in the list and processing time required. Here is my code which is otherwise working fine:

<script type="text/javascript" src="/_layouts/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/_layouts/jquery.SPServices-0.5.6.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
  $().SPServices.SPCascadeDropdowns({
   relationshipList: "BusSubProcesses",
   relationshipListParentColumn: "Process",
   relationshipListChildColumn: "Title",
   parentColumn: "Process",
   childColumn: "SubProcess",
   promptText: "Choose {0}...",
   debug: true
  });

 });
</script>

Do you have any suggestions about getting the drop-down to be more responsive and to be able to select an item with a single-click?  Is there a practical limit on the number of items you should have in the child drop-down box?

Thanks again,

William

 

 

 

 

Coordinator
Sep 15, 2010 at 11:43 AM

William:

The double click behavior is due to the way SharePoint renders dropdowns which have 20+ options. In that case, the dropdown in actually a hybrid input/select with some script and hidden fields to drive it, rather than a simple select. You'll see that behavior anywhere you have a dropdown which has 20+ options whether or not you're adding anything to the page, script or otherwise.

One of my rules is to "due no harm", so I leave that complex dropdown as is. This way, if the script fails for whatever reason, the user is left with the dropdown behaving exactly as it would if my code weren't there at all.

M.

Sep 15, 2010 at 1:57 PM

Thanks so much for the explanation.  That makes sense as this behavior isn't seen when I created a dummy set of cascading drop-downs with just 12 items.

Also, thank you for the prompt reply.  I hope that you do get to sleep sometime!

 

William

Coordinator
Sep 15, 2010 at 2:30 PM
Sleep? Feh. ;-) M.
Coordinator
May 9, 2011 at 7:41 PM

William:

If you're still out there, take a look at my blog post today: New SPServices Function: SPComplexToSimpleDropdown. Finally got around to building something to help with this.

M.

May 10, 2011 at 9:29 PM

Hi Marc

This new function works for single look up, and having issues for multiple lookups.

SSK

 

Coordinator
May 20, 2011 at 4:52 PM

Please try the new ALPHA: http://spservices.codeplex.com/releases/view/64390

M.